|
Try this link...there are many sample winsock apps out there, I was searching for them a few weeks ago and found hundreds of them...here is a good starting point though: http://tangentsoft.net/wskfaq/ Go to Yahoo and search winsock you will see what I am talking about.
|
|
|
|
|
Thanks, georgiek50 pal!
It is a very nice site!
Cheers,
George
|
|
|
|
|
What Windows network programming books did you read? I recommend Network Programming for Microsoft Windows, Second Edition by Anthony Jones and Jim Ohmund.
CodeProject has a network programming section with very good examples.
http://www.codeproject.com/internet/
Kuphryn
|
|
|
|
|
Thanks, Kuphryn pal!
Your recommendation is very nice!
Cheers,
George
|
|
|
|
|
When I debug my program, it says something like thread so-and-so has exited with code ######. There aren't any memory leaks but I don't know what the exit code means. Is there a list somewhere of what the codes are or does it really not tell you anything?
There's always one more bug.
|
|
|
|
|
Hi
Is there anyway to get accelerators working on a pure dialog application..
I've seen some notes about hooking into the message process but no examples of it..
I'm not using MFC.
Cheers
Chris
|
|
|
|
|
Have you tried changing your message loop to:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(hwnd, hAccel, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
I haven't actually written any apps with a pure dialog but this is what works for the other ones, and if it is a modeless dialog box then the same but you also need:
while (Getmessage...like above
{
if (hDlgModeless == 0 || !IsDialogMessage(hDlgModeless, &msg))
{
if (!Translate...like above
{
}
}
}
This is straight from Petzold's book...page 522. Hope this helps.
|
|
|
|
|
I'm a newbie in creating DLL projects and can't seem to solve this problem. I am using a similar technique to Steve Driessen's article[^].
I'm trying to create a DLL that exports a couple of classes that uses some MFC collection objects, but I keep on getting this warning:
<br />
warning C4251: 'CGifParser::m_aData' : class 'CArray<TYPE,ARG_TYPE>' needs to have dll-interface to be used by clients of class 'CGifParser'<br />
(m_aData) is a CArray that is a member of CGifParser, the class I'm trying to export).
The test program works correctly on a debug build, but not on a release build when testing the DLL.
I'm just trying to create a simple library so that I can reuse the code in other projects easier. Visual Studio .Net complicates everything! I first attempted this by trying to create a static library (.lib) but I got all these duplicate declaration errors from the standard C++ libraries. I'm use to simple command line linkers on Unix =).
Thanks.
- Anatari
|
|
|
|
|
This means the base class (CArray) was not declared to be exported. Try adding a line like:
template class __declspec(dllexport) CArray<Arraydata, Arraydata>;
Hope that will fix it..
/moliate
The corners of my eyes catch hasty, bloodless motion -
a mouse?
Well, certainly a peripheral of some kind.
Neil Gaiman - Cold Colours
|
|
|
|
|
Hi, I wrote my program using Visual Studio 6 and on Win98.
I used lots of new operator to allocate my object on heap and also to allocate a block of heap and use pointer/array that sorta thing,
everything works just fine and I never had any problem using the new []/delete[] thingy
but when I move my code to WinXP, everything is crash and burn, when I trace and debug it, sometimes my variables/member variables changed its value without any good reason. And sometimes I can't even delete my object
I've allready trace and debug it so that there are no mem. leaks and stuff, but the problem is still the same, and I've read that in WinNT(XP) it uses different dynamic heap managing method.
Is it true ?? so how do you manage your heap in your program in WinXP ??
Is there a safe way (just simple compiler/linker options) to make sure that my heap allocation runs correctly ?? without making any modifications to your code ??
|
|
|
|
|
Hi, I made a "chm" file for my application using Microsoft HTML help toolkits , it looked cool and all, the only problem was that I don't know what parameters, if any, can be used to specify(at runtime) which html page(suppose the chm file consists of multiple html pages) I want to display.
For example, my app has some CPropertyPage derived classes, pressing the "Help" button while different property page is active should display different help contents, right?
How can I do so? Thanks.
|
|
|
|
|
|
|
::ShellExecute(NULL,
"open",
"hh.exe",
"foo.chm::/bar.htm",
NULL,
SW_SHOW);
Enjoy!
|
|
|
|
|
Thank you!!!
-Dominik
|
|
|
|
|
Hey,
Probably a stupid question but how do I get a function to run after the dialog has loaded?
The situation is I'm writing a mp3->wav converter where a dialog should load up with a progress bar and a couple of static text labels. I just want it to load the dialog then run the Decompress function without any user input at all.
Putting the function call in initInstance just runs it before the dialog has loaded, and putting it in the constructor for the Dialog is causing an error in wincore.cpp.
Any ideas how to fix this silly problem? thanks guys
|
|
|
|
|
just show the dialog, don't call DoModal.
Back to real work : D-21.
|
|
|
|
|
I'm not too sure what you're meaning I'm afraid. I got it wrong in my first post, I was called the dialogs initDialog() and not the initinstance function.
do you mean changing the int nResponse = dlg.DoModal(); line in the app class? I tried changing that to dlg.ShowWindow(SW_SHOWNORMAL) but its giving errors
Sorry to be a pain in the ass about this and thanks for your help
|
|
|
|
|
You've got plenty of modeless dialog code snippets on CodeProject to play with.
Back to real work : D-21.
|
|
|
|
|
Pick a command ID, such as 100, then at the end of OnInitDialog() , call
PostMessage ( WM_COMMAND, 100 ); Add a handler for that command ID to the dialog, and do the conversion in that handler.
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Fantastic, thanks guys. I think my heads still stuck somewhere painful after my birthday drinks last night
|
|
|
|
|
Please tell me how or what to change in order to be able to write in HKEY_LOCAL_MACHINE-section of the registry.
Now I'm using the SetRegistryKey(), m_pszRegistryKey and WriteProfileString()
but I can't make them write anywhere else but in HKEY_CURRENT_USER.
Any help will be greatly appreciated!
|
|
|
|
|
May be a security issue. Check out you are allowed any write access with the regedt32 tool, (security menu).
Back to real work : D-21.
|
|
|
|
|
I doubt it's a security issue, because it's about writing a key in HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/Run - it's about a key that starts my application when Windows starts. Any suggestions how can I do this in other way?
|
|
|
|
|
WriteProfileString() is only used for per-user data such as options for the program. To write to any key in the registry, use the registry APIs or CRegKey in ATL.
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|