|
Kuniva wrote:
if the code increments from 0, the sequence number doesn't rise by 1 every packet but with A LOT more (the second packets sequence number is 16777216!).
Boy are you gonna feel stupid now. ;->
Have you checked what that number is in hex? Does 0x01000000 ring any bells? Network byte order and host byte order is a mismatch on IA32. Now start using htonl and ntohl.
|
|
|
|
|
lol! I don't feel stupid actually, i figured it would be something like that hehe
Thanks a lot for the help
Kuniva
--------------------------------------------
|
|
|
|
|
I have compiled ZLib source code in turbo c 3.0?
I want to use it on MSDOS for compressing and uncompressing the files.
My question is that
Is it possible to run ZLib code on MSDOS.
v
f
dssg
dsfg
dfsgsd
f
|
|
|
|
|
|
I want to randomly generate a number for the certain range of number??? How?? Help me
|
|
|
|
|
Most random number generators will provide a number between 0 and 1. If you want to produce numbers between 15 and 20, for example, the difference is 5 (20 - 15), and the offset is 15. So, generally, if you take rand()*5 + 15 you'll get numbers between 15 and 20.
rand() * range + offset
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
better in this case will be
rand()%(range+1) + offset;
use srand to initial your randomgenerator
Heiko
|
|
|
|
|
How can I convert a CString to a char * variable?
CString str;
char *szBuffer;
//code
.
.
.
szBuffer = (const char *) str; //why does this not work, and what do I have to do?
|
|
|
|
|
Use the getBuffer function.
|
|
|
|
|
CString str;
TCHAR *szBuffer=(LPTSTR)(LPCTSTR)str;
~RaGE();
|
|
|
|
|
Rage wrote:
TCHAR *szBuffer=(LPTSTR)(LPCTSTR)str;
This only works is you do not write into the CString.
If you really need to write into it, you have to use GetBuffer() /ReleaseBuffer() .
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Yep, I know, but in his initial example he tried to typecaste in a const char *, so ...
~RaGE();
|
|
|
|
|
Yeah, but that type of stuff IS really dangerous.
It works once you understood when to use it (at a InsertItem() with a LVITEM / TVITEM.pszText for example).
But IMHO it is nothing to tell beginners. Shhhh!
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
|
Hello I am looking for a source to get the common toolbar xp icons as described here[^]. I am really looking for the source files because I want to use them with alpha blending so I really need the transparency channel and it won't work if I just screencap and crop. I have been looking for them in systems DLL without luck.
Does anyone know?
Regards,
Nicolas
|
|
|
|
|
hey all,
i'm a beginner and have one problem.
I want to program a CListCtrl(report-view) object with the resource-editor within a non-modal dialog. Always when I declare a variable with the assistent for the object(CListCtrl variable), i get a DEBUG ASSERTION FAILED during carring out my application. Why?????
The same Project within a modal dialog works fine.
Can everybody help me???
thanks
Stefcos
|
|
|
|
|
What is the file and line # of the fired assertion?
|
|
|
|
|
Is there a easy way to acces desktop icons and move them around in x and y pos?
I think I saw a program that did that a while ago.
/Jarek
He believed the commercials that said drink beer, get laid
but at closin' time he was alone, he didn't get paid.
Last night his lover was a razorblade..
"Dan Reed song Mix it up"
What do you want to patch today?
|
|
|
|
|
How about getting a handle to the desktop window, and enumerating its child windows?
|
|
|
|
|
Okey sounds interessting but do you have some sample code or an example?
I never did it before!
/Jarek
He believed the commercials that said drink beer, get laid
but at closin' time he was alone, he didn't get paid.
Last night his lover was a razorblade..
"Dan Reed song Mix it up"
What do you want to patch today?
|
|
|
|
|
Something like:
HWND hDesktop = GetDesktopWindow();
EnumChildWindows(hDesktop, EnumProc, 0);
BOOL CALLBACK EnumProc( HWND hWnd, LPARAM lParam )
{
return TRUE; // to continue enumeration
}
I've not ever needed to do something like this before, but I suspect it will return more windows than just the icons. Top-level applications probably have the desktop as their parent window, too.
|
|
|
|
|
Thank you David!
I tryed that to and its just like you said it return manny windows, to manny.
But the search goes on I found a VB program that doing this and I am on my way to disassamble the code!
I think I have something to learn here It started as an effort to make a funny program but now its a chalange!
/Jarek
He believed the commercials that said drink beer, get laid
but at closin' time he was alone, he didn't get paid.
Last night his lover was a razorblade..
"Dan Reed song Mix it up"
What do you want to patch today?
|
|
|
|
|
Try this:
LPMALLOC pMalloc;
LPSHELLFOLDER pDesktopFolder = NULL;
HRESULT hResult;
LPITEMIDLIST pidlItems = NULL;
LPENUMIDLIST ppenum = NULL;
ULONG celtFetched;
SHFILEINFO fi = {0};
hResult = SHGetMalloc(&pMalloc);
if (NOERROR == hResult)
{
hResult = SHGetDesktopFolder(&pDesktopFolder);
if (NOERROR == hResult)
{
hResult = pDesktopFolder->EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &ppenum);
if (NOERROR == hResult)
{
while (hResult = ppenum->Next(1, &pidlItems, &celtFetched) == S_OK && (celtFetched) == 1)
{
SHGetFileInfo((const char *) pidlItems, 0, &fi, sizeof(fi), SHGFI_PIDL | SHGFI_ICON | SHGFI_DISPLAYNAME);
TRACE2("Icon handle for ]%s[ = %#x\n", fi.szDisplayName, fi.hIcon);
pMalloc->Free(pidlItems);
}
ppenum->Release();
}
pDesktopFolder->Release();
}
}
|
|
|
|
|
Thank you David!
It works I can get the Desktopicons
I saw similar code in Q&A on MSDN Thank you again your code was better.
/Jarek
He believed the commercials that said drink beer, get laid
but at closin' time he was alone, he didn't get paid.
Last night his lover was a razorblade..
"Dan Reed song Mix it up"
What do you want to patch today?
|
|
|
|
|
I've been reading some messages and articles, but I haven't found any example of using a DLL to store classes and then use them linking it dynamically in an exe.
At present, I'm using Delay Load to create instances of my classes, but I don't want to use .lib and .h files.
Is it possible to do that?
Thanks in advance.
|
|
|
|