CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2001
    Posts
    2,455

    [RESOLVED] MFC Regular Dll Help?

    I am trying to create an MFC Regular DLL. I followed a couple of tutorials on the net, and although my program builds, it crashes with an access violation when trying to debug or test. I have attached the code. Is it possible someone out there can download my application, run it, and tell me what I am doing wrong or just look at the code and give me pointers in the right direction???

    Any help is appreciated.

    Mike B
    Attached Files Attached Files
    Last edited by MikeB; April 15th, 2012 at 07:41 AM.

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: MFC Regular Dll Help?

    Code:
    int CompaniesHttp::GetManufacturers()
    {
    	return _T("TEST");
    }
    This functions returns an int, not a string.

  3. #3
    Join Date
    Jan 2002
    Location
    Houston, TX
    Posts
    1,421

    Re: MFC Regular Dll Help?

    I changed the signature to return a CString instead of int, and it ran fine in both debug and release.

    I also had to change the Debug Command parameter as it was pointing to some unknown \user directory instead of the default.
    Be sure to rate those who help!
    -------------------------------------------------------------
    Karl - WK5M
    PP-ASEL-IA (N43CS)
    PGP Key: 0xDB02E193
    PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

  4. #4
    Join Date
    Feb 2001
    Posts
    2,455

    Re: MFC Regular Dll Help?

    Quote Originally Posted by Skizmo View Post
    Code:
    int CompaniesHttp::GetManufacturers()
    {
    	return _T("TEST");
    }
    This functions returns an int, not a string.
    Yeah, I know, I switched from CString to int and back to CString again. Forgot to change the signature. Sorry about that.

    Mike

  5. #5
    Join Date
    Feb 2001
    Posts
    2,455

    Re: MFC Regular Dll Help?

    Quote Originally Posted by krmed View Post
    I changed the signature to return a CString instead of int, and it ran fine in both debug and release.

    I also had to change the Debug Command parameter as it was pointing to some unknown \user directory instead of the default.
    Thanks. Being that it was so little code, I just wiped the projects and redid them and all worked correctly the second time.

    Thanks for looking at it.

    Mike B

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured