|
yes... when I first wrote it, I didn't realize that I posted it in the wrong spot.
Mark
I am not discouraged because every wrong attempt discarded is another step forward.
-- Thomas Edison --
|
|
|
|
|
Marcus2001 wrote:
I didn't realize that I posted it in the wrong spot.
You've deleted it from the wrong spot, this thread no longer has a header.
I'm glad it worked for you - I only found out about that message myself a month or so ago. It's pretty cool.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
hey guys, just a quick one
If i have a OnReceive() handler defined in my CAsyncSocket derived class will OnReceive() be called again straight away if i dont read all of the data in the first OnReceive() call?
Or will it only be called again when more data arrives at the socket?
Thanks
ash
|
|
|
|
|
Hello, the codegurus around the world.;)
It depends on your code inside OnReceive() because
OnReceive() is just called by FD_READ notification message at the
background.
If you use Receive() memeber function in OnReceive and assign the small size
of char szBuf[5] to the first parameter of Receive(), OnReceive must be called
as many times as szBuf gets all buffer size from the socket.
This means that FD_READ is called at the same count.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
I have manged to get an icon to appear in my system try when i start my program. The problem is when i click it. Sometimes you need to right-click it twice to get the popup menu to come up, others times just once. How do i fix this?
This is the code i use to make the popup box popup:
int CMyClassDlg::OnTrayIconClick(LPARAM lParam)
{
switch(lParam)
{
case WM_RBUTTONDOWN:
<BR> {
<BR><BR> CPoint curPos;
<BR><BR> GetCursorPos(&curPos);
<BR><BR> CMenu mnuTop;
<BR><BR> mnuTop.LoadMenu(IDR_MY_MENU );
<BR><BR> CMenu* pPopup = mnuTop.GetSubMenu( 0 );
<BR><BR> ASSERT_VALID( pPopup );
<BR><BR> pPopup->TrackPopupMenu( TPM_LEFTALIGN | TPM_LEFTBUTTON, curPos.x, curPos.y, AfxGetMainWnd(), NULL);
<BR> }
<BR> break;
}
return 0;
}
Boredom
|
|
|
|
|
OnInitDialog() I am using GetCommandLine() to return the path to the program and the path to the file that is causing the app to be opened.. Anyway the GetCommandLine() returns a string that truncated.. is there a way to have the string be non shortened?
eg..
the path is "c:\The File That I have Double Clicked on.txt"
GetCommandLine() turns that path into
"c:\The File~1.txt"
Just wondering if there is a way to keep it from being shortened?
I wouldn't usually care but I am displaying the string and it looks really bad.
Thanks,
Rob
|
|
|
|
|
Have you tried GetLongPathName() ?
|
|
|
|
|
I'll give it a shot..
Thanks
Rob
|
|
|
|
|
GetModuleFileName is the recommended way to do what you want to do
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Hello,
I would like to know if a FILE* stream is opened or not.
I've search in the MSDN about this information, but didn't find any help.
Any ideas ?
TIA,
Stephane
"It is ridiculous to claim that video games influence children.
For instance, if PacMan affected kids born in the eighties, we
should by now have a bunch of teenagers who run around in darkened
rooms eating pills while listening to monotonous electronic music."
|
|
|
|
|
From MSDN entry on fopen():
... returns a pointer to the open file. A null pointer value indicates an error.
Jon Sagara
"Ninety percent of baseball is mental, the other half is physical." -- Yogi Bera
|
|
|
|
|
Thnaks, but it is not exacly what I want.
I assume that the FILE* is already opened, and I don't want to open it if it is already opened.
I've found :
http://www.tek-tips.com/gviewthread.cfm/lev2/4/lev3/32/pid/205/qid/94727
It seems that it is not possible.
Stephane
"It is ridiculous to claim that video games influence children.
For instance, if PacMan affected kids born in the eighties, we
should by now have a bunch of teenagers who run around in darkened
rooms eating pills while listening to monotonous electronic music."
|
|
|
|
|
Here is a round-about way to chk whether a FILE* is that of an open file
(1) use _fileno to get the file handle
(2) call _filelength passing this handle
if _filelength returns -1 file is not open else it is open
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Hello Everybody,
I would ask u if anybody know some free visual tool do build MFC classes. I mean a software that help to build an MFC GUI without write an ex-novo source code.
Thank you.
Giancarlo
Have a good day
|
|
|
|
|
There is a free edition of VC++ called VC++ learning edition.
I am not sure how you can get it, but I've seen it on CDs that come with several C++ programming books.
And you wont get the MSDN CDs either.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Do you mean a RAD tool?
The only MFC one I know about is http://www.capitolsoft.com/Default.htm
It isn't free but you are unlikely to find anything of this nature that is.
Of course I still prefer to use the Visual Studio Dialog Editor and hand code the rest myself.
Michael
|
|
|
|
|
I am using VC++ 6.0 with MFC. I have an app that needs to be a service that listens for messages from other pc's on the network. I have everything done, but I crash when I try to Call AFXSocketInit. If you know about services you really don't have a WinApp unless when you build the project you choose to use MFC as a dynamically shared dll. You have to set up the Service as a Console Win32 exe and then choose to use MFC. So the entry point is a "type" of main (_tmain). There for no OnInitialize for this project. No AfxSocketInit either. I believe when OnInitialize in the WinApp of a project gets executed there is a handle defined. I don't have that handle defined and I can't figure out why the AfxSocketInit doesn't work. If anyone has any suggestions I would appreciate all of them
Thanks
Carol
|
|
|
|
|
|
Hi all, again, this is just a quick question. I have managed to create my own OnOpen and OnNew functions in my project in the CMainFrame class, however, I`ve tried doing it exactly the same for OnSave (not OnSaveAs - yet, cos I can`t get this going) but the function never gets executed - despite me clicking the menu button Save (I get the crappy dialog box coming up with Save As on it for some reason???). Just wondered if anyone had experienced similar problems, and what the solution was. I`ve tried overriding in both CMainFrame and CMDIFrame class but neither works,
Cheers guys,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Hi U can override SaveModified which is the function which gets called when
the 'Save' or 'Save As' Happens, This is the function that prompts the Saving
and then calls DoFileSave-->DoSave.
So if u want to tailor to ur own needs i would recommend
that u copy the original code and modify to tailor ur needs,
U can find the source in 'doccore.cpp'(mfc src).
regards,
Prem
|
|
|
|
|
Hello could anyone please tell me how I can print a complete dialog box. My dialog box contains bitmaps and some images.
I know how to print individual bitmaps, but I want to print the complete dialog box.
Thanks.
Gautam
|
|
|
|
|
Hi There is an exampe in the Platform SDK
known as 'Zoomin' which basically captures
the screen using Bit Blasting, u can use the
same and send ur dialogs image to the printer.
regards,
Prem
|
|
|
|
|
I'm creating a program in Visual C++ using the Microsoft Foundation Classes, and I'd like to open a Word Document when I click on a certain button in my program.
Does anyone know how I can do this or where I can find the code?
I noticed another question which is similar to this was recently posted, but I'm not sure how to actually Open Word at the minute.
Any help will be greatly appreciated.
Thanks
|
|
|
|
|
Look in MSDN at (Q238611) "Embed and Automate a Word Document with MFC"
HOpe this helps,
Bill
|
|
|
|
|
Call ShellExecute() and pass it the name of your .DOC file.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
Test out a prerelease build of my Hotfix Checker v2.0! (133K)
|
|
|
|