|
I am sorry that the code i am using in wrapped in powerbuilder winsock.pbl (which is not either C or C++ code).
What i am wondering is ...why it is contradictory that winsock setsockopt() returns SOCKET_ERROR ( -1 ) but WSAGetLastError returns 0
Normally, in what situation will the setsocketopt of receive buffer resulting in error?
|
|
|
|
|
wk_leo98 wrote: I am sorry that the code i am using in wrapped in powerbuilder winsock.pbl (which is not either C or C++ code).
Sorry without code this would be just guessing into the blue sky... and there are many things that can go wrong if a 3rd party library/tool is involved. Maybe you can write your program in plain Winsock... or ask at a powerbuilder forum. Good luck!
/M
|
|
|
|
|
sorry for asking the question in the wrong forum.
I have posted the question in the powerbuilder forum, but haven't get any reply yet.
so, i am seeking help from forum. Really sorry for that >.<
Actually, we are using the PowerSocket Library.
http://www.level5software.net/documents/Pslib21.htm[^]
|
|
|
|
|
everyone know the difference of mswsock.dll vs Wsock32.dll?
|
|
|
|
|
The only thing that springs to mind is that your input values to the call are bad.
Set a breakpoint prior to th call and make sure the values are what you expect before issuing the call.
Without more specifics it is impossible to tell what is going wrong.Alan
|
|
|
|
|
hi,
I am running an application with ShellExecute() but not able to run in hidden mode
ShellExecute(NULL,_T("open"),_T("myapp.exe"),szCommandLineParameter,szTargetDirectoryPath,SW_HIDE);
SW_HIDE - Hide command line .
What is wrong?
|
|
|
|
|
Is it a cosole application?
Try using CreateProcess instead with STARTF_USESHOWWINDOW in the dwFlags member of STARTUPINFO and SW_HIDE in its wShowWindow member.
|
|
|
|
|
yes, this is console application
|
|
|
|
|
In that case, the solution that I gave using CreateProcess will work.
|
|
|
|
|
yes I tired but same result as ShellExecute. 
|
|
|
|
|
I tried this again and it works perfectly.
wchar_t szCommand[] = L"C:\\Windows\\System32\\Cmd.exe";
STARTUPINFO si;
::ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
PROCESS_INFORMATION pi;
::CreateProcess(0, szCommand, 0, 0, 0, 0, 0, 0, &si, &pi);
|
|
|
|
|
yes this will hide the command prompt but what about the other application which will launch through command prompt.
wchar_t szCommand[] = L"-m -l";
STARTUPINFO si;
::ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
PROCESS_INFORMATION pi;
::CreateProcess(_T("myapp.exe"), szCommand, 0, 0, 0, 0, 0, 0, &si, &pi);
|
|
|
|
|
JM2251 wrote: yes this will hide the command prompt but what about the other application which will launch through command prompt.
You're correct: Cmd is hidden but the app it's executing not. Some solutions:
- create a shortcut to the exe and run that one. In the shortcut you can set options to hide it.
- If it is a console app you could route the display output to a NULL device (example:
Dir > null). See createprocess options.
Hope this helps
|
|
|
|
|
What type of exe you are using...?
|
|
|
|
|
|
First try with SW_SHOWNORMAL mode. if it is working fine then try with SW_HIDE. If it is also not working then check the exe path and command line arguments.
Is it running in normal mode when you using SW_HIDE argument...?
|
|
|
|
|
how can i typecast LPSTR to DWORD_PTR?
DWORD_PTR nBmpID = GetItemData(hTSelItem);
LPSTR lpNodeData = (LPSTR)GlobalLock(hgNodeData);
((DWORD_PTR)lpNodeData) = nBmpID;
shows error
error C2106: '=' : left operand must be l-value
|
|
|
|
|
What's a hTSelItem and what's a hgNodeData ? And what's the point in typecasting something that's on the left side of the assignment operator?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
RakeshManohar wrote: ((DWORD_PTR)lpNodeData) = nBmpID;
change to
lpNodeData =(LPSTR) nBmpID;
|
|
|
|
|
Thanks.. this the right way.
|
|
|
|
|
What a mess. What are you trying to do?
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]
|
|
|
|
|
That's the same exact thought what occurred to me. Which is why I asked the OP a few questions hoping that I could help him, but some other helpful soul has answered the query.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
It's the semantic problem the trouble, Watson, the semantic, my dear, not the syntatic one!
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]
|
|
|
|
|
Hi All,
I want to display a message to the user at the time of locking the machine.
The message is to warn the user saying "Before you lock, please check your POWER settings." .
Is there any way to do this ?
Thanks,Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|