User Profile

Collapse

Profile Sidebar

Collapse
craig1231
craig1231
Last Activity: Jan 28 '12, 04:11 PM
Joined: Mar 17 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • craig1231
    started a topic How to expose Decorated Names of a DLL to COM?

    How to expose Decorated Names of a DLL to COM?

    I can sucessfully expose functions of a DLL to COM, but in a specific application, it is expecting a decorated name
    Code:
    ?EuroScopePlugInInit@@YAXPAPAVCPlugIn@EuroScopePlugIn@@@Z
    How I can expose a decorated name? I currently have...
    Code:
    void EuroScopePlugInInit(out IntPtr Plugin);
    See more | Go to post

  • Hey, that works, thanks Alex! I only had to allocate the structure in memory. However I have a new problem... which I shall start a new thread... regarding callbacks and garbage colllection.

    Craig
    See more | Go to post

    Leave a comment:


  • Hehe you wouldn't believe how long it took to write. I hope its clear enough. I use a similar function without structures, that passes strings and numbers fine. Its just when I pass structures that it comes up with the Exception. Does it have something to do with the way the struct is Marshalled?

    Having made a test program to send an unmanaged struct to a c++ function, it works, but I am still confused as to why it doesnt work in the...
    See more | Go to post

    Leave a comment:


  • craig1231
    replied to Calling MFC DLL from C#
    Well this can be attacked in many different ways, but heres how I would do it;

    Have the function return 'const char*' instead of 'CString'

    CString theString( "This is a test" );
    char* mychar = new char[theString.GetLe ngth()+1];
    _tcscpy(mychar, theString);
    return mychar;

    then in C# use DLLImport to import the function which it will now return a normal C# string that is recognised...
    See more | Go to post

    Leave a comment:


  • craig1231
    replied to Calling MFC DLL from C#
    Those look like debug strings. Build -> Clean Solution. Ensure the Configuration is set to Release. Then Build -> Build Solution

    Craig
    See more | Go to post

    Leave a comment:


  • AccessViolationException - passing Structures between Unmanaged and Managed Code

    I have a problem trying to pass a structure to an unmanaged c++ DLL from C#. When I call PCSBSpecifyPilo tLogon from C#, it throws an AccessViolation Exception

    This is what I have...

    The exported C++ DLL Function;

    Code:
    __declspec(dllexport) void PCSBSpecifyATCLogon(PCSBSessionID, const char * inServer, unsigned short inPort, const char * inID, const char * inPassword, const PCSBATCConnection_t * inInfo);
    ...
    See more | Go to post
No activity results to display
Show More
Working...