|
Are you wanting to read text from the socket one complete line at a time?
|
|
|
|
|
Pretty much.. I am actually sending a Structure through the socket.. and after some debugging I find that sometimes I get a FD_READ issued and only half of the structure is there to read..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
OK, well i created this[^] to grab text out of a socket one line at a time... binary is somewhat similar, but instead of looking for a line of text (with \n being the end indicator) you would look for a particular structure... and instead of a "ReadTextLine" function you would need something like a "ReadStruct" to get the structure out. similar concepts. basically collect what you get, put it in something, and then when you get what you want, take it back out and use it.
|
|
|
|
|
If all else fails, try the FAQ.
http://tangentsoft.net/wskfaq/[^]
There is a book review section as well.
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
Why doesnt my program recive them the messages seem to go straigh to the toolbar i have tried to map OnKeyUp OnKeyDown OnChar all at once and non work
here is the code im using for all 3 of them
void DlgMapEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch(nChar)
{
case VK_UP:
curr_room.y -= 1;
MessageBox("Key Up OnChar");
break;
case VK_DOWN:
curr_room.y += 1;
break;
case VK_LEFT:
curr_room.x -= 1;
break;
case VK_RIGHT:
curr_room.x += 1;
break;
}
UpdateDisplay();
CDialog::OnChar(nChar, nRepCnt, nFlags);
}
the code for all 3 is relitivly the same but it doesnt even get to the message box
so whats the deal is there something special i have to do?
when i hit the arrow keys it moves around the selected button on the toolbar and i dont want that :P
i also tried to use OnSysKeyUp OnSysKeyDown and OnSysKeyChar but none of them work it all goes to the toolbar
SOMEONE PLEASE HELP!!!!!
thanks
|
|
|
|
|
Dialogs do there own keyboard handling, so you won't see keys like VK_UP. You'll need to get in before the normal dialog processing does. Try PreTranslateMessage() - not sure if that works with dialogs though.
Hooking these keys in a dialog seems strange though.
If you look below the editing window you will see a toolbar to format code etc. Please try and use that.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I am thinking of buying "Microsoft Visual C++ .NET (Standard)" but I am confussed about the ".NET" bit. I am a C++ programmer - I program Win32 (sometimes MFC but usually just Win32) and DirectX (i am currently using VC++ 6) and I was wondering if this new version of VC++ allows you to create programs without having to use the .NET framework (basically like you would normally with VC6)?
|
|
|
|
|
|
Anonymous wrote:
I am a C++ programmer - I program Win32 ... and DirectX
One good reason to upgrade to VS.NET for DirectX development is the DirectX debugging extensions for VS.NET (including shader debugging, breakpoints on screen areas, texture inspection, etc.) that is included with the DX9 SDK (you'll need to reinstall the SDK after installing VS.NET and you currently need to be on WinXP).
- Mike
|
|
|
|
|
Thanks to both of you for your quick responce.
|
|
|
|
|
On the fly, I want my prog to make a list of the files in a directory. SO in DOS I would say
e:\> cd myDir<br />
<br />
myDir:\> dir/b > myList.txt . How do I get this functionality to occur in my MFC program?
Thanks
Appreciate your help,
ns
|
|
|
|
|
Create a CFileFind object. For each file found, write the name to a CStdioFile object.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Use the CFileFind class in MFC
See this URL :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cfilefind
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Thanks so much. Its exactly what I need! The sample code is right there in your link!
Appreciate your help,
ns
|
|
|
|
|
|
Hi, I'm developping a gui for a command based application and I need to launch and terminate that command based program. The gui runs on a windows platform and the command-based program runs in unix platforms and also in windows (there are 2 versions). I also need the ability of copying and retrieving files (also retrieve file properties such as size and time, etc).
So the question is simple:
Which technology should I use in my gui to "communicate" (launch/kill) with that multiplatform command-based program? Should I use RPC or there's another technology better for this specific case?
Thanks in advance.
|
|
|
|
|
xatanu wrote:
Which technology should I use in my gui to "communicate" (launch/kill) with that multiplatform command-based program?
If it (i.e., the command based application) resides on a machine separate from the GUI machine, check out RPC.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thank you very much for your fast answer.
The problem is when the command based app resides on a different machine: i'll check RPC.
When it resides on the same machine i think it's quite simple using ShellExecute.
Can you advise me some documentation about RPC that could help me?
I think there's an easier method: using rsh (remote shell) commands for launching and retrieving files, but then it's not possible to kill the processes. What do you think about this method?
Greets
|
|
|
|
|
Alright you guru's. I have a question for ya. I have a test application that at first I set all the GDI objects (boxes, Rich Edit control, and lines) using the MM_TEXT (display locations). I found out what a logical inch was (Using MM_TWIPS at 1440x1440) and converted that to display for the current display and printer. On my main system the conversion from LPtoDP returned 102x108 and for the printer 1201x1204. When I copied the application to a different OS (using VMWARE), with the resolution set to 1024x768 and doing the same thing, it returned either 81x81 (or 96x96) and the printer varried by 1 or 2 (probably due to rounding). When I would print using the display locations, I wanted the boxes to be 1inch x 3inch and 1inch x 7 inches. The print outs as I expected were not 1x3 or 1x7 or even close. Using the Logical units they were pretty close!
Next I tried switching all the values to TWIPS and then converting the TWIPS to display units to create the controls. On my main system, it looked darn good. On the VMWARE Os, the output looked different.
What I need is several fold.
- Am I correct in saving the logical (TWIPS) values and using LPtoDP to convert to display units to create the controls?
- Is my assmption correct in saying that 1440x1440 converting to LPtoDP gives the correct DPI for one inch the way the display is configured?
- What are the traps that I maybe falling into and how do I avoid them. Device independent drawing.
Thanks
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
HUMMM, I maybe assuming something that is not correct!
The code to calculate the LPtoDP is as follows:
Lx = Logical x direction
WOx = Window Org x direction
VOx = Viewport Org x direction
WEx = Window Extent x direction
VEx = Viewport Extent x direction
Dx = Device Unit x direction
Dx = ( Lx - WOx ) * VEx / WEx + VOx
So, with this knowledge in a 1280x1024 resolution screen the values are as follows:
Dx = ( 1440 - 0 ) * 1280 / 18142 + 0
Dx = 101.598501 and rounded up to 102.
When this same calculation is done on a 1024x768 screen the value rounded come out to be 81.
So, the question is how do I get the text (rich edit... starting to hate these things!) that was created in a 1024x768 res screen like it did when it was created in a 1280x1024?
Do I come up with some puzzles or what?
Thanks if you can answer. I really guess I don't quite understand!
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
I want to do something like "Print Screen" button do. when you press this button you can capture what ever is visible on the monitor as an image. How can I do it.I want to take some parts in the screen but I guess functionality is the same as getting all the screen.
Mazy
No sig. available now.
|
|
|
|
|
I don't complete understand your question as the Print Screen button does exactly what you are after (i.e., it captures the entire screen or the active window) and copies it as an image into the clipboard buffer.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
DavidCrow wrote:
what you are after (i.e., it captures the entire screen or the active window) and copies it as an image into the clipboard buffer.
Yes,how does it capture the screen?
Mazy
No sig. available now.
|
|
|
|
|
I don't know. Something built into the keyboard driver I suppose.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi
I have a dialog which is pretty big. When resolution '1024*768' is used, no problem. But when '800*600' is used, i can't see the entire dialog.
Is there anyway to have scrollbars on it? I've put some scrollbars on it, but it doesn't seem to work :S
|
|
|
|