Home Forums HTBasic Forum about call dll-C and CSharp Reply To: about call dll-C and CSharp

#9370
PatB
Moderator

    Hi Dongxu,

    I setup a similar test where I created an unmanaged C++ dll and from it called into a managed C# dll. Loading the unmanaged C++ dll from HTBasic and calling the unmanaged function that calls into the managed dll, I was able to reproduce the same exception you are seeing. I have spent some time looking into it and finally found a solution. There were two steps I needed to take before i was able to call the unmanaged dll function from HTBasic successfully.

    First, make sure that your unmanaged DLL and Managed DLL are both targeting x86 since that is what HTBasic targets.

    Second, put the managed dll into the same folder that the HTBwin.exe file is in.

    Hopefully this will allow it to work for you.

    Thanks,

    Pat

    Scroll to Top
    HTB icon

    Please Sign In