|
Possibly the call (from your app) to dynamically load DLL1 fails because DLL1 depends on loading DLL2. DLL1 starts loading, and then, since you linked in DLL2, DLL1 attempts to automatically load in DLL2. But, if DLL2 is not found in the directory of your app, or in then system path, then it craps out since DLL1 can't find DLL2, fails, and in turns causes the ultimate failure of DLL1 loading. Don't know if this is really your case, but it's a guess.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Hi Jim,
Thank you for your help. I finally found out what happens. I put DLL_2 into my DLL_1 project directory. For whatever reason, DLL_1 cannot find DLL_2. I have to put DLL_2 into the system directory. Then, my program works perfectly.
|
|
|
|
|
I have to put DLL_2 into the system directory
Noooooo!!!
Agh, I hate when people have to do this. I can sympathize with your problem though, and it is an easy solution, but it ultimately will cause problems, either because this will force your users to have admin rights to install your software, or you may find dependency issues, or accidentally overwrite an older version of your dll with a newer one, etc.
You might consider trying to add the directory that holds your DLL2 to the users' path variable.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
I'm just learning programming(C++ is the language being taught), but I just want to make sure I'm reclaiming the memory correctly here. If I created an Employee object, and then in 'main' create an array of Employee pointers, do I reclaim the memory at the end of main by first deleting the pointers and setting them to 0 - followed by the deletion of the array? I'm just wondering the best way to go about this as the book never has the EXACT example I'm looking for. Thanks!
|
|
|
|
|
more or less what you wrote ...
the technicality depends on what kind of array you are using, either MFC, STL, or basic C type array.
remember that for each new there should be a delete and for each new [] there should be a delete []
what book are you refering to ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Well, the book I'm referring to is 'How to Program C++' by Deitel and Deitel. And while there is a page that has NEARLY similar code, the pointer to the object is just a single instance, not an array of them. So, there is no delete [] employeeContainer . By the way, when I first learned arrays, I never saw a delete [] at the end of main - why is that? Now, in the example I'm seeing in the book, I see that the class Employee it created, they user character arrays for the firstName etc. So, why in the destructor must you delete that array explicitly and not have to when you delcare an array in main? Thanks!
|
|
|
|
|
By the way, when I first learned arrays, I never saw a delete [] at the end of main - why is that?
There's nothing special about main --as Maximilien said, everything you allocate with new [] you must deallocate with delete [] .
If you saw otherwise, most likely the code you were studying was simply incorrect.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
LynnJ wrote:
By the way, when I first learned arrays, I never saw a delete [] at the end of main - why is that?
Technically it's not necessary, but it is highly frowned upon to not clean up your mess(es). Once main() is done, Windows will free up any resources, including memory, that your program was using. This is not a license to write sloppy code, however.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi,
In my program I have a main window with lots of buttons inside it. All I have are the handles to the buttons, in HWND form, and I create them using CreateButton. So for instance I have something like:
HWND new_button = null;
new_button = CreateWindow(blah blah etc);
The problem is, when I set the cursor of the main application to what I want, the cursor always returns to the default when I move it over the buttons. Is there a way I can set the cursor of those buttons to be the same as the one I use for the main application window?
I'm not using any class for the buttons so I can't for instance call SetCursor from inside the buttons, all I have are HWND variables.
Thanks
Kelly Ryan
|
|
|
|
|
To reliably set the cursor of window without cursor flicker, you need to have a NULL cursor specified for the window style. Then you need to handle WM_MOUSEMOVE messages and then properly set the cursor using SetCursor() (see this API call in MSDN).
If you really need to do this you can always subclass the BUTTON window class and then add you own behaviour to it. If you are using MFC then you can derive a new class from CButton (or whatever it's called), and add a mouse move handler and override the CWnd::PreCreateWindow() function.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
A little correction - WM_SETCURSOR is the right message to handle, because it takes into account mouse capture.
--
I'm Michael Dunn and I approve this post.
Vote Trogdor in oh-four!
|
|
|
|
|
"I'm Michael Dunn and I approve this post."
That's hilarious! LOL
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
It's a special election-themed sig
--
I'm Michael Dunn and I approve this post.
Vote Trogdor in oh-four!
|
|
|
|
|
I've got it working, thanks!
Kelly Ryan
|
|
|
|
|
How to display a html page of the internet (i.e. http;//www.mycompany.com) on a dialog?
I know HtmlView is very easy but it is in doc-view style.
we use VC6.0 now.
thx
includeh10
|
|
|
|
|
|
Maximilien,
I found a sample in MSDN and developped a simple app, it works fine now.
thx a lots.
includeh10
|
|
|
|
|
Hi, I'm Javier. I want add to my application a control button. But I don't want the typical rectangular button. I want add a picture resource, and change the button's appearance, for example that it looks an arrow(a bitmap picture), but the control is the same functionally, the only change is the appearance.
¿How can I do this?
Tahnk you .
|
|
|
|
|
Hi Javier.
What I did when I encountered this problem was to write my own button class - assign each button a bitmap that you display, assign the button coordinates and width/height or whatnot, and then every time there's a mouse click, just look through your buttons to see if the click was inside the coordinates and parameters.
I use this for all of my games nowadays and it works great. 100% customization. But of course then you have to write your own class for it. I don't know of a way to do what you're asking using the default windows API.
Kelly Ryan
|
|
|
|
|
have you looked here for some example of non restangular buttons ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
thanks for answering. I have found interesting classes in this web, made by Davide Pizzolato
. They're great.
Bye.
|
|
|
|
|
I succesfuly build my projects that use MFC in VC++ 6.
But if try to build them in .NET I get this error. When I select in project properties "Use Standart Windiws libraries" - it wass builded as well. But when I select "Use MFC ..." this on appear?
|
|
|
|
|
Hi,
I was working with date conversion, converting from system time to variant time (double) and I found that I lose the milliseconds in that conversion.
This is some sample code:
DATE Val;
SYSTEMTIME sysTime, res;
::GetLocalTime(&sysTime);
::SystemTimeToVariantTime(&sysTime, &Val);
::VariantTimeToSystemTime(Val, &res);
The milliseconds field in res is always set to 0; it doesn't matter the value of the millisecons field in sysTime.
I haven't found this issue documented in the MSDN. If someboy knows where could I find some documentation I would really apprecciate it.
Also, if someboy knows about a function that completes the same conversion without losing the milliseconds I would also appreciate it a lot.
Thanks,
Federico
|
|
|
|
|
Federico Milano wrote:
Also, if someboy knows about a function that completes the same conversion without losing the milliseconds I would also appreciate it a lot.
Before trying to fix a "conversion" problem, what is your net goal? Keep in mind that VariantTimeToSystemTime() ultimately calls VarUdateFromDate() which sets the wMilliseconds member to 0.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi All
does any one know how to get the HTTP status code of a web address
for example, if i pass in http://www.google.com it would return 200
or if i did
http://www.frefoeijrnferfnerf.com it would return 404
any ideas ??
ta
si
|
|
|
|