|
Igen1 wrote: a multiple instance dll or a static lib
I didnt get you.
Igen1 wrote: I have perversions in programming, but this is why evryone likes my work...
Igen1 wrote: HGLOBAL hp = (HGLOBAL) GetWindowHandle(handle, 0);
I am not sure about this function.
Igen1 wrote: I'm not sure how will this be permanent
I think they are doing the same mechanism that I suggest. But instead of keeping the data (here it is a structure, instead of class that I suggest) in the window's user data, they are keeping it in global memory.
- ns ami -
|
|
|
|
|
Igen1 wrote: Edit: OK maybe I can make a use of the answer, but the instance is always know itself, but how could the parent know about the window??? In the example I just load the dll and it calls registerclass when DLL_PROCESS_ATTACH and that is it! So how to get the window handle for/from the parent?
You edited after my reply...
Igen1 wrote: So how to get the window handle for/from the parent?
You should have the export class for you control. That is advisable. So you can call the your own function named Create( HWND parent, .... ) or something like that.
- ns ami -
|
|
|
|
|
ns ami wrote: You edited after my reply... Smile
lol Sorry I didn't see it at the time...
I don't know this export class thing you say, but I rhink it's a greater problem now that I can't call any of my functions in the class and whats more? I can't even compile the testapp becouse it can't find the constructor and destructor... The problem is with the calling. __stdcall and extern "C" is the answer I know, but not with classes becouse it uses C++ no metter what I try.
|
|
|
|
|
Igen1 wrote: I don't know this export class thing you say
OK... so I think reading something like this[^] will be useful for you.
- ns ami -
|
|
|
|
|
Sorry, I know it seems like I'm an amatuer, but it's becouse of the good for nothing tutorials around the net. I've made dlls before, but mostly in MFC. I just fed up with Visual C++ and started to learn everything in native Windows. But this was about 8 years ago so don't think I never read somthing like "that". But these are just don't working or don't give answers to things like the unresolved externals becouse of the nameing c++ uses...
I tell you onece more to be clear. I have a problem that when exporting my class it uses c++ nameing so the functions can't be find under the specified name becouse it renames them - it add something unmeanful string to it. And this isn't changes even if i'm using exter "C" or __stdcall or even I use compiler/linker options to use Standard Call. Now answer this. VC++ never complaind about things like this but Borland c++ just doing things like this and there isn't any topic that says if you encounter this kind of problem then do the following and everything will be allright. So this is a problem and with the first question I was asking some opinion which one is better lib or dll and if dll than how to use the message handler and the class in several instances. But this isn't getting clear reading beginner tutorials and advanced tutorials are not available in the topic exept the one I posted but you don't even know how it works with me. now that is the sum.
I'll read a lot and post an article with this topic with no VC++ and MFC in it...
|
|
|
|
|
Igen1 wrote: If one want to load a dll in different apps, it will probably mess up the data it have. This is becouse It implemented as a class that have it's own data and functions.
Control instance-specific data would be loaded on the heap and hence it's a non-issue if it's packaged as a DLL or not.
Steve
|
|
|
|
|
So you saying that if I load the dll for another app it will be another entry in heap for the variables in the class (or globals too)?
Then what if I want several of the control in one app - on eno dialog? My problem is the message handler here. So it will use the same code, but with the current instances variables if I'm understanding clearly.
|
|
|
|
|
If you load a DLL in another app then:
- The globals will be different.
- The heaps will be different.
Steve
|
|
|
|
|
Hi Friends,
I am in need of writing a client application using vc++ which will fetch me "cookie timeout value"
How to retrieve cookie timeout value from the cookie information(data. Any APIs or sample code?
Thanks in advance
poojaaa
|
|
|
|
|
You mean cookies used on the web? Aren't the way cookies are stored specified to the browsers? So IE stores them this way in this format, FireFox stores them that way in that format and so on...?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi ,
im using URLDownloadToFile to download an exe Please let which api i can use to download multiple exe"s and is it possible to check whether the desired exe is present in the web server.....
Thanks,
455
|
|
|
|
|
pradeep455 wrote: possible to check whether the desired exe is present in the web server
IsValidURL()
pradeep455 wrote: which api i can use to download multiple exe"s
I'm not sure if something exists, But why not you multithead?
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
if u don"t mind can u give a sample to achieve this....
|
|
|
|
|
pradeep455 wrote: im using URLDownloadToFile to download an exe Please let which api i can use to download multiple exe"s...
Didn't you just answer your own question?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
1/ Download first file.
2/ Wait till done.
3/ Download second file.
4/ ...
a)
Many webservers will limit the amount of files you can download simultaneously. It's polite to not flood them with requests.
b)
Assuming your connection is going as fast as it can, downloading them in parallel will just make each one take longer - you're still downloading the same amount of data after all!
c)
Package them in a zip file? Then you can download them all in oen big go.
Just a few thoughts,
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
would there be any data member in the CwinThread Object to point it the Process where I want to create the thread
|
|
|
|
|
You want to create a new thread in a remote process with CWinThread ?
As far as I know, this is something which can't be done: you can only create a thread in your own process.
|
|
|
|
|
Actually, it can be done: CreateRemoteThread[^]
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I didn't know that, I learned something today
But, in which situations is this usefull ?
|
|
|
|
|
Well, where i have seen this being used was here[^], but there might be numerous other uses for it...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Cedric Moonen wrote: But, in which situations is this usefull ?
Thread outsourcing
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
That's nice...
- ns ami -
|
|
|
|
|
I guess I have to use the the WIn32 SDK api
|
|
|
|
|
|
was looking for something whtin the CWinThread Class I guess I'll have to stick to WIN32 SDK
seems like the real low level Api's Dont have Objects to suppourt them
|
|
|
|