|
Hi. Thanks for the answer. However, using ping is not very good idea because a site might block the request. Hence, there is always a request time out.
Any other method that I could use?
Thanks
Hendrik
|
|
|
|
|
Hello, the codegurus around the world.
So, I told that the application pings to a couple of URL.
In fact, www.cnn.com didn't work for the ping.
CNN web site adds some functionality to take off ping command from the router?
If at least of one URL among 100 URLs works, this measn the local computer connects Internet.
We don't need all 100 URL information, so if 5th URL works,just skip 95 URLs.
Good Luck
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
why not ping codeproject.com
|
|
|
|
|
Hello, the codegurus around the world.;)
Basically, I don't want to make Codeproject website slow....
We should avoid DOS (Denial Of Service) ? to Codeproject web site.
Even though Codeguru web site responses fast, Codeproject responses too slow.
I hope that Codeproject web site uses mutli-cast host for this web site.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
I have a regular DLL (that uses MFC). It has an app class (as expected). There is an "interface" .cpp/.h file that allows executable programs to use the dll. Many/all of these interface functions use "((CMEDS32App*)AfxGetApp())" to get a pointer to the DLL's app class and calls functions in that app class. The interface functions all use "__stdcall" in the protoctypes, so it looks like they were conetmplating allowing the DLL to be used from other languages (VB, etc). This all looks pretty normal to me.
Can someone comment on how difficult it would be to compile the code contained in this DLL to a static .lib file?
|
|
|
|
|
sounds to me like it would depend on how much the code relied on the CWinApp stuff. if it's just calling out to a bunch of classes that really don't care about the current CWinApp, then it might be easy - just clip off all the CWinApp stuff and add some AFX_EXT_CLASS macros to the classes you need to export.
but, without seeing the code, it's tough to say.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Hi all,
I am trying to post a structure to a Created Worker Thread !All the members of the structure are BSTRs.I am defining all the members of the structure & posting the structure as the WPARAM of PostThreadMessage.(I am typecasting the pointer to structure as WPARAM).
The problem is I am able to post the structure with all the member values correctly !But while getting that Thread Message & retrieving the values of the members some of the Member values r received wrongly !I have used SysAllocString while getting back the values of members !
How can I rectify the problem !
Thanx!
Y.Yamini Devi
|
|
|
|
|
Yamini,
It sounds like you are passing in a pointer to the structure properly, and some of the data is correct. But since the interface thread is still running, perhaps the values that were originally stored in the structure have been changed before you got a chance to read them? (Just a side note to be sure that you use a Critical Section or a Mutex to ensure that one thread is not writing new data to the structure at the same time the other is trying to read it.)
I'm assuming that you do cast the WPARAM back to the correct structure pointer when the message is received by the worker thread.
If checking on this stuff doesn't help, reply to the post, and I'll try to think of other reasons this may be happening.
Jeff
|
|
|
|
|
I got the following message in reply:
Thanx for the ideas !I created a worker thread .I am posting message to this worker thread only ! As you said I am passing the pointer to structure as WPARAM of the message !Now, in the ThreadProc of this worker thread I am typecasting the WPARAM of the message to the structure pointer and retrieve the members of the structure !Here only I am receiving the wrong value for some data members(Of the 11
members the last 4 member values are wrong !)What can be the problem ?I had tried with Mutex & critical section.Still the same problem exists !
How can I overcome this problem ?
Regards,
Y.Yamini Devi
|
|
|
|
|
Yamini,
It depends on how you know the members are wrong. If you are using a byte index into the structure and coming up with the wrong values, or if you are looking into memory locations directly, then the problem may be how the structure is defined. If you don't tell the compiler to pack the structure to 1 byte values then when it builds the structure it may pad spaces onto the end of intermediate values to get the 'correct' block sizes. If you have strutures within the defined 'communication' structure, this problem can be compounded. Check that you use the compiler directive "#pragma pack (1)" around your structures to be sure that the compiler is not adding additional empty bytes. Once all the structures are defined you can use "#pragma pack ()" to return the pack value to its previous setting.
Just a thought
Jeff
|
|
|
|
|
Hi, does anyone knows how I can get the handles to all child-windows of the Active or Foreground window? In WINDOWS CE! I know there is an API call EnumChildWindows, which work perfecly on the desktop, but is not supported on CE... (PocketPC)
Is there an other way to do this?
Greetings
Kasper
|
|
|
|
|
Now ,I have a question to cancel the Kana mode of Japanese IME,So I think must get current Kana mode,but how can I get it? use witch IME API to get it ?
Thank you !
|
|
|
|
|
Hello, the codegurus around the world.;)
Taking off and on IME may be easier to change the input type.
That is, if IME is on, the default input type is Kana.
If IME is off, the default input type is the direct input type like A-Z or number.
Check ImmGetContext, ImmGetOpenStatus, and ImmSetOpenStatus API function
and some sample code of IME in MSDN help to take on and off IME.
If you want to get the exact input type, we may have some code and
assgin the exact input type which we want.
But, so far, I have not succeeded this yet.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Hello,
I got a major issue with trying to set DATE on files, not TIME, that works flawless. Here's the way I did:
void CDialogAttribs::DoDataExchange(CDataExchange *pDX)
{
...
DDX_DateTimeCtrl(pDX, IDC_ATTR_DATE, m_tmeDate);
// m_tmeDate is a CTime; IDC_ATTR_DATE is a "caleneder" control created in resource
...
}
{
...
CFileStatus fs;
CFile::GetStatus(file, fs);
fs.m_atime. = m_tmeDate;
CFile::SetStatus(m_strFile, fs);
// I KNOW for a fact that m_tmeDate holds valid numbers in month/day/year field
// before doing ::SetStatus..
...
}
ANY TIPS!?
Cheers,
Henrik
...
}
|
|
|
|
|
Hi I'm going to ask Who can I use TolTip in my program.
Thanks a lot.
|
|
|
|
|
you are in codeproject you find sample about that go to
Dialog and Windows Programming , then Tooltips in modal dialog boxes
AHMAD ALWASHALI
|
|
|
|
|
Hi
I'm Use CFileDialog to open file,
But I Want to open Folder Browse dialog.
Help me to do it.
Thanks a lot.
|
|
|
|
|
G'day Iman,
Check out the SHBrowseForFolder function in the docs.
That should get you started.
Steve
|
|
|
|
|
Hi Steve.
I Use the SHBrowseForFolder function But I don't know what Include file is for this function.
Iman Ghasr-e-fakhri
|
|
|
|
|
G'day Iman,
shlobj.h should do the trick.
Steve
|
|
|
|
|
Iman Ghasr-e-fakhri
|
|
|
|
|
Hi Steve
Please mote Help me
Iman Ghasr-e-fakhri
|
|
|
|
|
|
Hi
I want to use CreateProcess Function,
but this function not work true (not execute my .exe file).
Thanks a lot.
|
|
|
|
|
Hi,
I used the function CreateProcess in many applications.I can even start an ATL Service!
The code goes like this .
STARTUPINFO suinfo;
memset(&suinfo,0,sizeof(suinfo));
PROCESS_INFORMATION procinfo;
BOOL result;
for(int i=0;i<10;i++)
{
result=CreateProcess("<path of="" yr="" exe="">","",0,0,FALSE,NORMAL_PRIORITY_CLASS,0,0,&suinfo,&procinfo);
if(result)
{
cout<<"Client process created\n";
}
else
{
cout<<"Failed to create the client process\n";
exit(0);
}
}
This will work !
Y.Yamini Devi
|
|
|
|