|
i'm sorry, i shouldve replied... i need help mostly with the sockets, and u read my mind, i would actually like to follow up with applying the IRC protocol ... any help/sample code with documentation/comments with mostly the simple chat part that u can give would be GREATLY appreciated... thanks for even replying so far
|
|
|
|
|
for the protocol, search on the net for the RFC1459.
I found a good page about this, but.... in french fortunately, i'm french so i don't have translation problem, but i aggree, that will be hard (very hard) for you ! lol
anyway, you can have a look if you want at this :
http://www.csadmin.net/rfc1459.php
About sockets, i don't knom myself about CSocket, but but you can also have a look at "Beej's Guide to Network Programming", Originally made for Unix/Linux socket programming. Csocket and Linux Sockets are not so far... that can be very interresting to read it (PDF format), but i've lost the address. you'll have to search for it once again
TOXCCT >>> GEII power
|
|
|
|
|
I already have links to the rfc, its programming with the CSocket class that i need the help with...
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_windows_sockets.3a_.sequence_of_operations.asp
if u didnt go through this site then please try.It will give you better idea about sockets
|
|
|
|
|
Thanks alot for the link, but i've done most of my research at MSN. However, i am very happy to say that on further trial&error, i've managed to get the code working... thanks so much for the help thateveryone has given.
|
|
|
|
|
Hello at all,
imagine the following situation:
You have created an auto-signaled event, and multiple Threads are waiting for this event to get signaled. The event in addition gets signaled, and one thread starts its execution which implied the event has gotton nonsignaled. So my question is, when does the event gets again signaled ?
Thanks in advance!
|
|
|
|
|
What made it get signalled originally?
If some process/thread is running and periodically signalling, then presumably it can signal again. If not, something has to happen to kick-start. Would the thread that was started not signal the thread prior to waiting on the event?
Steve S
|
|
|
|
|
|
Greetings...
In VC++ 6 I want to create an activeX that contains another activeX, is this possible?
I have tried subclassing the control but I cant get the thing running?
It works if you subclass from ActiveX's that are listed in the project wizard dropdown (upon wizard project creation, step 2 I think, like BUTTON for example) but does not if you are trying to inherit from a custom activeX!!!
Cheers
|
|
|
|
|
Hi Guys,
I have run into a problem for which I havent found a solution till now.Iam trying to show it here in a perspective in which Iam doing it:
I want to draw a bitmap to the screen
m_deviceContext-is the deviceContext to Which I want to draw my Bitmap.
Its mapping mode is set as MM_TWips.
CDC dcMemory;
dcMemory.CreateCompatibleDC(m_deviceContext);
CBitmap *bitmap=CBitmap::FromHandle(handle);//Handle of BitMap is passed here.
BITMAP bm;
bitmap->GetBitmap(&bm);
CBitmap* pOldBitmap = dcMemory.SelectObject(bitmap);
I draw it as follows:
xCord,-yCord,srBpWidth),srBpHeight are in Logical units.
m_deviceContext->StretchBlt(xCord,-yCord,(srBpWidth),(srBpHeight),&dcMemory,0,0 ,bm.bmWidth,bm.bmHeight,SRCCOPY);
(Figure Attached)
I get the figure but it is drawn from the co-ordinate point "up"(As a mirror Image ).I want it to drawn "Down" from the co-ordinate point or Is there any way to inverse it....
Thanks....
|
|
|
|
|
Solved The Problem...............
|
|
|
|
|
Hi,
I use the function ShellExecute(......) to open a file.
How to find if a file has been already opened?
Thanks,
|
|
|
|
|
hello, i'm doing a project using mfc, vc++... i'd created a dialog as my first window, i decided to create a menu as my second window, however, to link the menu to the dialog is not as easy as what i think...
if i wanna call a second dialog using the first dialong, i may use the .domodal to call it... but if i wanna call a menu, what should i do with it???
help!!!
|
|
|
|
|
I guess it's CMenu::TrackPopupMenu you're looking for, probably with TPM_RETURNCMD flag.
Tomasz Sowinski -- http://www.shooltz.com
no animal was harmed more than once during creation of this post
|
|
|
|
|
If you want the menu options to always be available. Do something like this in your OnInitDialog()
CMenu menu;
menu.LoadMenu(ID_OF_MENU);
SetMenu(menu.m_hMenu);
menu.Detach();// now owned by dialog
DrawMenuBar();
The dialog will destroy the menu automatically when itselef is destroyed
You then just need to write ON_COMMAND() handlers for each item. If you need to enable/disable items, handle the WM_INITMENUPOPUP message and process the individual items there.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
I'v got a CString string as follows
CString strPacket = "$1234567FFFFFFFF#00
I want to parse the string so that str1 = "1234567" & str2 = "FFFFFFFF"
Any suggestions on how to do this
At the moment I'm using the following, however there must be an easier way of doing this.
m_strRspData = "";
for(i = 1; i < 9; i++){
m_strHex = m_strRspPacket.GetAt(i);
m_strRspData += m_strHex;
}
m_strRspData.MakeUpper();
|
|
|
|
|
Try Tokenizer class at Codeproject.
Robert-Antonio
It's a good luck, if you meet a real fink. Then you get a respect to
normal, mid-honest people."
|
|
|
|
|
Something like:
int x = 0;
while (isdigit(strPacket[x]))
{
str1 += strPacket[x];
x++;
}
str2 = strPacket.Mid(x); However, if you are always breaking between the 8th and 9th characters, just use Left() and Mid() .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
VC6.0
Hello,
i have a question, how can i terminate a process from an another process? Ich my Situation i want start program b.exe from a.exe. But b.exe should start once a time! I do it with that:
1) First start b.exe:
PROCESS_INFORMATION ProcInfo;
STARTUPINFO startupInfo;
memset(&startupInfo, 0, sizeof(startupInfo));
startupInfo.cb = sizeof(startupInfo);
CreateProcess(NULL, // lpApplicationName
"C:\\b.exe", // lpCommandLine
NULL, // lpProcessAttributes
NULL, // lpThreadAttributes
NULL, // bInheritHandles
NULL, // dwCreationFlags
NULL, // lpEnvironment
NULL, // lpCurrentDirectory
&startupInfo, // lpStartupInfo
ProcInfo); // lpProcessInformation
2) Second i check, wheter program is still activ
HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS,TRUE,pProcInfo->dwProcessId);
if (handle!=NULL)
{
... if programm b.exe activ terminate b.exe ...
}
else
{
... start b.exe ...
}
3) If programm b.exe active i terminate it and restart it
I do it with this code:
TerminateProcess(m_pProcInfo->hProcess, 0);
Now i got back to step 1:
This works fine in w2k, but in xp step 2 doesn't work. The handle is always not NULL.
What is wrong? Give's a better way to do that?
Thanks
Chris
Student
|
|
|
|
|
From the top of my head: maybe instead of PROCESS_ALL_ACCESS you should use PROCESS_TERMINATE?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hello Tomasz,
thank you for your tip. I changed PROCESS_ALL_ACCESS to PROCESS_TERMINATE in OpenProcess(...). But i have the same effect as before.
When i alredy had terminated the programm b.exe and it doesn't exist in the tast-manager. I do step 2 and the handle is alawy not NULL. But i see this effect only in XP. W2k show me NULL and I can start b.exe with createprocess.
What do i wrong!
Thanks
Chris
ceuba@gmx.net
Student
|
|
|
|
|
ceuba wrote:
When i alredy had terminated the programm b.exe and it doesn't exist in the tast-manager. I do step 2 and the handle is alawy not NULL. But i see this effect only in XP. W2k show me NULL and I can start b.exe with createprocess.
The process ID may be reused, so maybe you're getting the handle for other process? Anyway, since you're calling CreateProcess yourself, why don't you use another thread and WaitForSingleObject?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I need to convert CString string to unsigned long. Exammple
Need CString strPacket = "FFFFF400" to unsigned long
Also any idea how to add a value to strPacket. What I mean is
strPacket = "FFFFF400" + "4" = "FFFFF404";
|
|
|
|
|
sscanf((LPCTSTR)strPacket, "%ul", &myulVar);
simple, rustik.... assuming that your string is a valid unsigned long value...
TOXCCT >>> GEII power
|
|
|
|
|
Caoimh wrote:
I need to convert CString string to unsigned long.
Use strtoul() for this.
Caoimh wrote:
Also any idea how to add a value to strPacket. What I mean is
strPacket = "FFFFF400" + "4" = "FFFFF404";
Assuming that strPacket is a CString object, this is perfectly valid:
strPacket = "FFFFF400";
strPacket += "4";
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|