That did it, I would never have though to mark DllMain with extern "C".
If you're ever in Dorset (UK) I owe you a beer or two!
Type: Posts; User: DaveHope
That did it, I would never have though to mark DllMain with extern "C".
If you're ever in Dorset (UK) I owe you a beer or two!
Thanks for the time you're putting in to helping me out. I'm not doing much error checking in the client, however I'm fairly sure LoadLibrary() isn't failing. Code is as follows:
using...
Just my luck, when using the vc++ compiler the problem doesn't occur. The code compiles (after some minor tweaks) and my ofstream stuff works and I can step over the breakpoints.
The same code,...
Thanks Codeplug,
I've actually got a full Visual Studio 2008 license for some work that I do so will just install the c++ component and try and compile with VS2008 and see what I get.
Will let...
Thanks for all your help thus far guys. I've rewritten my test case to use C++ and get the same problem.
Dllmian is as follows:
std::auto_ptr<myClass> myInstance;
/**
* @brief DLL Entry...
Nope, DLL is the latest version.
My DLL test app is currently c#, which makes debugging the usage a bit of a pain. I'll rewrite my test app in c++ using LoadLibrary rather than DllImport/PInvoke...
Thanks, just tried that but the same problem ocured. I've even tried using std::ofstream in DllMain to write out some info but nothing happens :/
If I manually do myClass...
Thanks codeplug, I understand why that code doesn't work now. I've read through the Microsoft document you referred to (I'd seen it before, but was worth re-reading). The document says the ideal...
adeyblue,
I've given up looking for a decent alternative solution and am trying to use the code, however it errors as follows
Code:
HMODULE MyClass::getCurrentModuleHandle()
{
Thanks adeyblue. Currently my application runs on Win95+ (other than GetLastError which is 2k+), I'm not keen to introduce dependencies on this newer stuff unless I have to.
Can you think of any...
That was the only bit I typed out rather than copying & pasting, and I messed it up. The code actually reads
myClass myInstance( hinstDLL_ );
If I do the following, it works perfectly. But I'd...
Hi all,
I have a DLL which has a method (extractRcdata) which extracts a resorurce from itself. This works perfectly when it's run as a standalone binary, but not as a dll.
/**
*...
Thanks for the link. I'll admit, I had no idea you couldn't (easily) achieve this with windows.
Thanks to the both of you for taking the time to respond to my question!
outPutCSV() doesn't spawn a thread, It extracts some RCDATA, accesses the registry, saves to a CSV file and that's it.
I'm not sure if I've managed to get my point across. Consider the following:...
Hi All,
I have a GUI windows application that has some command line ( non-UI options ).
When the application is run from the command line, it detatches from the cmd process and still runs. For...
Thanks for your help, I was copying the values from ReturnArray but forgot to copy the code into the post.
I malloc'd the two char*'s which formed ReturnArray also, which resolved my issues.
...
Great, that may just be it! Thanks.
When compiling my DLL, I get:
warning: address of local variable `ReturnArray' returned|
I'm doing the following.
Thanks for the reply. If I reduce dllGetPoductKeyInfo() to just one call I get the same problem:
har** dllGetProductKeyInfo( int Type )
{
typedef char** (*GetProductKeyInfo)( int );...
Hi all,
Firstly, my appologies for the appauling title of this thread - but I couldn't think of what to describe my problem as.
I have a C++ DLL built, which I'm using code from. Most of it...
When SS_NOTIFY is set and ShellExecute() is removed the cursor doesn't change. It appears that as soon as SS_NOTIFY is set the WM_SETCURSOR message doesn't get called.
Hi All,
I'm trying to imitate a hyperlink on a dialog using C++.
I'm using a static control with SS_NOTIFY set so that a user can click the control and go to a webpage.
CONTROL...
Thanks for your input guys, i'm a hobbyist programmer, i'm just going to re-write a section of the code to try and illustrate what i'm trying to achieve rather than post a lot on relavant code :)
...
Thanks guys.
cpjust - Because a load of APIs I'm calling require char*, so rather than store as a std::string and then convert I figured it best to just store as char* in the first place.
Thanks guys.
I was looking at going down the custom routie option for std::sort(), but am unsure of how to pass the child to the predicate. I've looked arond (honest) but can't find anything...
Hi guys,
Is there a way I can use std::sort() to sort a 2D vector by the value of its first member?
So, for instance:
std::vector< std::vector<char*> > ProductKeyInfo;