|
As far as I know it is stored under the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ProductId key. At least it is on Win2k and Win98.
|
|
|
|
|
Hi
How do I get the workstations Workgroup name, and domain name? I have to get these in Windows 95(second edition),98,NT,ME,2000,XP. I would like to know the domain name when the user logs on, even windows 95..
thanks
Neil
|
|
|
|
|
I use 1 my class derived from CSocket - MFC as usually.
In server, I use an object of this class as a listening socket. Now, can you help me in solving this problem:
-Once a client connect to server, whole transaction between server and that client is run in a separate thread.
At this time, I can't solve it. I just use a CPtrList of many CMySocket, each in a connection.
In my opinion, using thread is better, but I can't.
Help me !
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
The moment a new socket connection is established, spawn a new thread. Though if there are too many connections in parallel, this is not a recommended method
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
How can I load a dynamic images as background (of my View, of my edit box background, richedit box background), and on foreground, I can still show my text. (It look like Yahoo Messenger with dynamic IMEnvironment.)
I found a way seems good, but actually, it's not good:
-Use background as CHtmlView, and load a web page with dynamic images (.gif)
But, I can't use DrawText or TextOut to write string on it.
Any way ?
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
By "dynamic images", do you mean animations?
--------
Higher education helps your earning capacity. Ask any college professor. --Shog9 --
|
|
|
|
|
Hi.
I was wonder about the best way to varify if a socket is currently active. In other words, I need a way to determine if there is a connect on a socket. This is just for command update UI. Basically, if the socket is active, I enable/disable something. If not, I enable/disble something.
How about this code?
// if (mysocket == WSAENOSOCKET)
// socket is invalid or inactive
Thanks,
Kuphryn
|
|
|
|
|
Call getsockname on the socket. If you get an error, call WSAGetLastError and chk and see if the error code is WSAENOTSOCK
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Okay. Thanks.
johnnie2 posted a different solution using a similar approach to setting pointers to NULL. Your solution looks like it is a more sophisticated and safer approach.
Here is a link to the code I mentioned.
http://www.cprogramming.com/cboard/showthread.php?s=b3cf15b75e3287ca197b18fc2d335361&postid=111612#post111612
Kuphryn
|
|
|
|
|
Hi,
I just want to set a menu as owner draw...
How do I do That ?
thanks.
|
|
|
|
|
There are numerous owner drawn menu examples here on CP. Take a look at them.
http://www.codeproject.com/menu/
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Hi,
Im using the following to get a list of windows running:
EnumWindows((WNDENUMPROC)AddWinsList, 0);
And within the routine I am doing the following:
BOOL CALLBACK AddWinsList(HWND hWnd, LPARAM lParam)
{
if (!IsWindowVisible(hWnd) || GetWindow(hWnd, GW_OWNER) != NULL)
return TRUE;
TCHAR szClassName[80];
GetClassName(hWnd, szClassName, 80);
if (lstrcmpi(szClassName, _T("Progman")) == 0)
return TRUE;
char szWndText[556];
GetWindowText(hWnd, szWndText, 556);
if (strlen(szWndText) > 0)
AfxMessageBox(szWndText);// just display window title
DWORD p,i;
i=GetWindowThreadProcessId(hWnd,&p);
HANDLE hProcess = OpenProcess(
PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
FALSE, p);
char FileName[50];
GetModuleFileNameEx(hProcess,?,FileName,49); //? dont know how to get the 'module handle'...
////////////////
I dont know how to get the module handle above in (GetModuleFileNameEx) the second field, anyone any ideas?
thanks
|
|
|
|
|
Use <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/psapi_1wz7.asp">EnumProcessModules</a> (only NT/2k/XP) or <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/toolhelp_5450.asp">CreateToolhelp32Snapshot</a> (9x/ME and 2k/XP.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
in normal image viewer program,
if i see DICOM image, How can i make code?
another say, i'm making a image viewer
like bmp, jpg format, in viewer seeing dicom format
in program, shall i add which code?
|
|
|
|
|
u want to add support for viewing / manipulating images of type DICOM? am i right?
you would have to get some reference on the format and code it urself if you can't find a library that will do it for you
"... and so i said to him ... if it can't dance and you can't eat it either f**k it or throw it away" 8028finder.com
|
|
|
|
|
Hi!
Try:
http://www.psyc.nott.ac.uk/staff/cr1/dicom.html
Mukkie
|
|
|
|
|
http://www.yxhome.com/softplus/image/view_window.gif
more : http://softplus.126.com
|
|
|
|
|
lszyn wrote:
http://www.yxhome.com/softplus/image/view_window.gif
Doesn't exist mate. Unless you were pointing out how interesting a Chinese 404 error looks...I believe CP is always looking for paying advertisers, but spamming the message boards does nothing but piss people off.
--------
Higher education helps your earning capacity. Ask any college professor. --Shog9 --
|
|
|
|
|
Shog9 wrote:
Unless you were pointing out how interesting a Chinese 404 error looks...
ROTFLMAO
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nothing interesting! what did you suppose to do? To let people guess the Chinese characters?
No spam here please.
不要在這裡散佈廣告, 謝謝.
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
Hi.
I am working on a simple message program via IP and TCP protocols. Right now, I ininitialize a listening socket on a default (I set at 21). The user can change the port anytime; however, the actual SOCKADDR_IN that was binded with the listening socket is working on the default port.
Is there a way to modify the port in a SOCKADDR_IN in real-time? Do I have to close the listening sock and bind it with a new SOCKADDR_IN with the new port?
Thanks,
Kuphryn
P.S. From my experience with ftp servers and clients, I believe you have to "reconnect." Thus I believe you have to close whatever socket and start over. I would like to make sure that is true.
|
|
|
|
|
kuphryn wrote:
Do I have to close the listening sock and bind it with a new SOCKADDR_IN with the new port?
Yes, you would have to do that, if you want to change the port it is listening on.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
|
Is there a way to get _CrtIsValidPointer() to work in the release version of a build? I'm trying to track-down a memory write that only happens in the release version and would like to know *before* the app faults.
RZ
|
|
|
|
|
You may be able to call it using "LoadLibrary" and GetProcAddress but it will not help you. I think you need to do the following :-
1. Change project settings to include debug information for even the release builds if you have not done so
2. Run the program and make it crash consistently atleast two times. See the location and memory address.
3. If the memory address is same all the time then you are lucky.
4. At the start of next debug session set the breakpoint so that it breaks when the memory location changes. Given the address same as you found in step 3.
This will break at all places memory gets overwritten and you can figure the problem out.
|
|
|
|