|
I have added a button and edited the name in the resource edits to make it say "Browse," but I do not know where to go from here... Do I need to add a handler or a class? I'm pretty much a newbie at MFC... and I dont know which route to take.
Thanks
|
|
|
|
|
Tadpole wrote:
Do I need to add a handler...
Yes. Use ClassWizard for this. It will add an ON_BN_CLICKED() handler in the message map.
|
|
|
|
|
Hi! Everybody:
I'm using TCP CSocket, I unpluged a client cable connected to the server intentionlly. But server can not detected such event, and kept waiting for the return from Sending function untill the error message appeared. I just wonder how to detected such event that can cause the server crushed. It will be appreciated if someone can give me any advice?
Ray Li
|
|
|
|
|
What socket functions are you using?
- Anders
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi! Anders:
I'm using Send function, if I unplug a client's cable, when server call Send function to send data to this client, it will wait there for over 15 seconds.
then I can know the error message returned from Send. I want to know if there is a way to detect the send error(or socket error) quickly.
Thanks
Ray
|
|
|
|
|
Hi,
How can I get a pointer to a pointer of an object in 1 line? What I want is this:
<br />
class A { int i; }<br />
<br />
A a;<br />
A** aa = &&A;<br />
But that doesn't work, otherwise I wouldn't have asked here I could ofcourse do
<br />
A a;<br />
A* aa = &a;<br />
A** aaa = &a;<br />
but that takes another line. Can it be done in 1 line? Thanks.
cheers,
roel
|
|
|
|
|
roel_ wrote:
A a;
A** aa = &&A;
should be
A a;
A** ppa = &&a;
|
|
|
|
|
To me only the following makes sense:
A a;
A* aa = &a;
A** aaa = &aa;
because to have a pointer to a pointer you must have declared memory to hold the first pointer. In this case aa must have a memory location. In a one liner how do you reserve space for aa ? If you don't declare space for aa what does aaa point to?
John
|
|
|
|
|
A is data, with a memory location.
&A is the memory location of A, and is an l-value.
&&A implies the 'address of' 'address of' A, or the address of an lvalue.
Which neither makes machine sense, nor is allowed or really possible.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Thanks for explaining it better than me. I knew that this did not make sense...
John
|
|
|
|
|
If you don't declare space for aa what does aaa point to?
Other process memory space and crash.
|
|
|
|
|
Hi everyone.
I'm having a problem with the CreateProcess routine. I'm calling using the following:
if (CreateProcess(cmdArg, cmdFileName,
NULL,
NULL,
TRUE,
DETACHED_PROCESS /*CREATE_NEW_CONSOLE */,
NULL,
NULL,
&si,
&pi) != 0){
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
}
It works absolutely perfrect with the execption of one thing, the Application calling this doesn't return from the CreateProcess call until the process created returns. I really need the Call to return so I can shut down the calling Process after I'm done.
I looked at using WinExec but that doesn't return either. What am I missing here? What method should I use?
Thanks!
|
|
|
|
|
Something's not right in the hen house. Per the documentation, "...because CreateProcess() returns without waiting for the new process to finish its initialization."
|
|
|
|
|
OOPS... there is something wrong...
CreateProcess() should return immediataly, and if you want to wait for the created process you must use :
WaitForSingleObject(pi.hProcess, WAIT_OBJECT_0)...
?
|
|
|
|
|
A stupid question that I just can't answer...
My class inherit from CFrameWnd, how do I set the window size to be different than the default size when it pops up ?
Shay
|
|
|
|
|
Override PreCreateWindow(CREATESTRUCT& cs) and change the values for cy and cx of cs.
John
|
|
|
|
|
OMG I can't believe I forgot the answer to this question. A long layoff (in the land of VB) and coming back I can't remember. When you statically link MFC do you have to include in your distributable the mfc70.dll? Or, does the user even need it? I know dynamically linking they would need it but can't remember about statically linking.
TIA for such a dumb question.
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
|
|
Hi ,
How Base64 convert "A"(i mean to say single charater) , Or How Base64 convert "image" when send with attachment. I want to know how is it encode the character and decode when receive the character.
plz give me in detail.
Thanks
|
|
|
|
|
|
Check out Bob Withers download section.
http://www.ruffboy.com/download.htm
|
|
|
|
|
I am creating a 'ResDiff' tool to determine if two modules have similar or different resources.
I can already load all resource blocks as binary blocks of data and detect if they are the same or not, but I am having trouble decoding the STRINGABLE block, which can contain up to 16 resource string entries each.
It seems MSDN is all over what the RC file format is, but is very unclear about what the binary format is once it is compiled into an EXE file.
Does anyone have a link they can point me to with an explanation or some sample code?
Thanks.
C++/MFC/InstallShield since 1993
|
|
|
|
|
Check out Matt Pietrek's MSDN article "Peering Inside the PE: A Tour of the Win32 Portable Executable File Format", specifically the "PE File Resources" section.
|
|
|
|
|
Hi everyone,
I am trying to scroll a window by more than one unit at a time. currently I am doing this
[CODE]
for(int i=0; i<100; i++)
pParent->m_SkinList.PostMessage(WM_VSCROLL, MAKELONG(SB_LINEDOWN,0),NULL);
[/CODE]
I have my current code inside a for loop to make it scroll down multiple times and it works, but it freezes up my app until the for loop is done.
How can I scroll by multiple lines using a single PostMessage call? Can I scroll variably in a single call without using a for loop?
Thanks,
Greg
|
|
|
|
|
The HIWORD of the wParam parameter is the position to scroll to
pParent->m_SkinList.PostMessage(WM_VSCROLL, MAKELONG(SB_LINEDOWN,nPos),NULL);
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|