|
You know.. that subject line sure looked suspicious for a forum like this.
--
They say the most horrible things, but I hear violins.
When I close my eyes, I'm at the center of the sun.
|
|
|
|
|
We don't have a medical forum yet, Jörgen.;P
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
True. I figure this forum can only treat missing semicolons and related issues.
--
They say the most horrible things, but I hear violins.
When I close my eyes, I'm at the center of the sun.
|
|
|
|
|
Good night and happy New Year.
Excuse my English as it's not my languaje.
My problems are two: I've just began learning VC++ on my own and I need to send a file using ZModem protocol.
I have searched for some code to learn from, but all I found was for Unix and wasn't commented or documented, so that and nothing is more or less the same.
Could someone explain something practical (not history or comparatives with other protocols) about zmodem or tell me where I could find a ready to use c++ class or activeX.
One more solution would be automating Hyperterminal, but i don't know if it's possible and as I said, I'm a beginner at VC++.
Any info is wellcome.
Thanks.
|
|
|
|
|
I did a search on Google[^] using the words "ZMODEM" "C++" "source" and "Windows", and came up with a large number of hits. Take a look and see if any of those fit your needs.
Software Zen: delete this;
|
|
|
|
|
I would like to understand how you can print the string from an edit box using dcPrint?
Example: dcPrint.TextOut(50,150,Editbox string here);
anyhelp greatly appreciated
ThankYou in advance.
Still no advice on how to achive this, does anyone have any sugestions that I might try?
|
|
|
|
|
hi,
ON_COMMAND(ID_FILE_PRINT, OnFilePrint)
printing goes like this
void CMyDialog::OnFilePrint()
{
CString strValue;
int iRet;
CPrintInfo Info;
//set your info flags
PRINTDLG pdsetup;
HDC hdc;
//get your hdc from pdsetup
CDC dc; //dcPrint???
//Attach hdc with dc
//set drawing rect
//call OnPreparePrinting(&Info);
//call OnBeginPrinting(&dc, &Info);
DOCINFO docInfo;
// make your docinfo if needed
//iRet = dc.StartDoc(&docInfo);
//iRet = dc.StartPage();
//OnPrepareDC(&dc, &Info);
myEditBox.GetWindowText(strValue);
dc.TextOut( 200, 200, strValue); //place own coordinates
//dc.EndPage();
//dc.EndDoc();
//OnEndPrinting(&dc, &Info);
//dc.Detach();
hope it helps
dan
|
|
|
|
|
I'm trying to create a very simple diagnostic utility for Win98. In VC++ with MFC, how do I found out the numeric IP address of the computer on which the program is running?
|
|
|
|
|
One way is to call gethostname() followed by gethostbyname() .
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Thank you but that seems to only get me the domain name. I'm trying to get the IP number so that I can track when the DHCP assigns a new one.
|
|
|
|
|
I'm not sure what your code looks like, but gethostname() and gethostbyname() is for getting the IP address of the host machine (i.e., the machine running the application).
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
What exactly does the line:
rGfxOptionsWnd* m_pGfxOptionsWnd;
do?
I have chased this bug and narrowed it down to something that I believe should not happen and I don’t even know what could possibly cause it to happen.
My basic application structure is simple.
An Application Class,
An App Class derived from the Application Class
The application class has a member varible which is a Paramater class
e.g.
Application {
Public:
Param_class m_Params;
};
In it’s constructor Application instalises m_Params values.
<code> m_Params.Window.bWindowed = false;
m_Params.Window.width = 500;
m_Params.Window.height = 500;
m_Params.Window.icon = NULL;
m_Params.Window.title = "rDirectXApp Default Window Title";
m_Params.Window.wnd_type = RJM_WNDT2;
m_Params.Window.res_x = 0;
m_Params.Window.res_y = 0;
m_Params.Window.esc_to_quit = true;</code>
In it’s Constructor, App (Derived from Application) then alters some of the values as nessecary.
<code> m_Params.Window.icon = (const char *) IDI_ICON1;
m_Params.Window.title = "Super Game in this window!!!";
m_Params.Window.bWindowed = true;
m_Params.Window.wnd_type = RJM_WNDT5;
m_Params.Window.width = 600;
m_Params.Window.height = 300;
m_Params.Window.bWindowed = true;
m_Params.Window.res_x = 100;
m_Params.Window.res_y = 100;</code>
Now I can compile and run this code perfectly. I have set break points on each line shown here and I can watch the values as they go through this process and change.
I have another completely empty class, just an empty constructor and destructor.
RGfxOptions. I add the following line into Applications private section:
rGfxOptionsWnd* m_pGfxOptionsWnd;
With this line in the program I run the debug version of the program.
The Application constructor sets up m_Param exactly as it’s supposed to.
Control then passes to App’s constructor.
When: m_Params.Window.icon = (const char *) IDI_ICON1;
executes, m_Param.Height changes (nothing else)
when m_Params.Window.title = "Super Game in this window!!!";
executes, m_Params.title changes but the new value is corrupt
when m_Params.Window.bWindowed = true;
executes, nothing in m_Params alters
when m_Params.Window.wnd_type = RJM_WNDT5;
executes, nothing
when m_Params.Window.width = 600;
executes bWindowed alters
when m_Params.Window.height = 300;
executes, width alters
when m_Params.Window.bWindowed = true;
executes, nothing
when m_Params.Window.res_x = 100;
executes, wndtype alters but to an invalid value
and after m_Params.Window.res_y = 100;
the program crashes because of the invalid data.
But with the line:
rGfxOptionsWnd* m_pGfxOptionsWnd;
remmed out it all works perfectly.
Can anyone help? What does that line do? How is it possible that the statement altering the height actually alters the width member variables? I havn’t used or refered to m_pGrgOptionsWnd anywhere at all in my code. How can simply adding a pointer member varible to my class have this effect?
Thanks in advance for any suggestions. I have absoultly no ideas at the moment at all!
---
Posted By Robert Metcalf
|
|
|
|
|
My bet is that you need to do a rebuild-all. The line added just adds an extra 4 -bytes (a pointer) to the size of your object. If its declared before the m_Params member, then m_Params is now offset by an additional 4 bytes. If your .cpp file(s) have not been completely rebuilt since this declaration change, you may find that one file is using the old declaration and another the new one. This will cause assignnments etc to change the wrong members of m_Params.
To check this, move the declaration of m_pGFx... to after m_Params
Or just force a rebuild all
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Hello-
I would like to use a very simple XML description to layout some customizable dialogs in an application. I was hoping I could find a relatively simple XML parser available as open source.
I looked at Xerces and although it would certainly do the job, it is far more complicated than necessary. Any suggestions?
Jake
|
|
|
|
|
|
or try searching for
CMarkup (Here on CP For Developers version, from FirstObject)
pugXML (Here on CP)
both are 'tiny' and do great job
'G'
|
|
|
|
|
|
for all c++ coders out there...
i need to write a program that determines dependencies between c++ source files. Besides parsing and scanning for "#includes" and "::'s" what else would do? I need to parse and find ALL calling dependencies (ie. function calls). How would yo go about it to try to encompass all of them (if possible)?
btw, I am most definitely not asking anyone to write code for me. I would like to hear your approaches and sugestions regarding such a problem. What patterns should I look for? Thank you.
tuco
|
|
|
|
|
Well, I've written a small part of what you are talking about here:
http://www.codeproject.com/useritems/includefinder.asp[^]
However, I've undertaken projects to do what you are talking about, and if I were you, I'd start with the source of a proven compiler like g++ to do this. If you are trying to do it from a "this would be cool to write" perspective, then start by getting yourself a good book on compiler architecture, like the Dragon Book (Compiler Principles, Techniques, and Tools[^]), or some such other book (there are probably other good books out there).
Good luck with it anyways
Chris Richardson
|
|
|
|
|
How to do that? I have a directory filled with *.gif images (but if it'd be more useful, I can convert them to *.bmp) and I want to have them displayed in a Picture box. How to do that?
I only have to know how to open an image file (*.gif or *.bmp or whatever) and display it in a picture box. I can manage all the other steps (Well, I guess I can...)
Tnx.
|
|
|
|
|
use the CBitmap class from the MFC to load *.bmp files. but then, you have to draw it with GDI
a Picture Box aequivalent is maybe the CPictureHolder class
scio me nihil scire
My OpenSource(zlib/libpng License) Engine:
http://sourceforge.net/projects/rendertech
Its incurable, its a Pentium division failure.
|
|
|
|
|
"use the CBitmap class from the MFC to load *.bmp files"
But how exactly? I see no functions in that class or any parent classes that could do that...
|
|
|
|
|
Hi, I'm doing a simple packet filtering firewall as my final year project. I'm at the early stages of my project and I've already studied about the types of internet firewall out there and other security overview information.
So, I need detailed information on how to build a firewall. Can you guys point me to good tutorials/information that might help? I'm using Visual C++ to code and MFC to create the GUI. Also, since I'm doing it in a Windows platform, I've heard that I need some sort of a driver, can you help explain this part as well?
Thx,
gildan2020
|
|
|
|
|
For the winsock part of the design, I recommend this book.
Network Programming for Microsoft Windows, Second Edition by Anthony Jones and Jim Ohmund.
Kuphryn
|
|
|
|
|
yup, thx for da tip
i remember that i've to deal with some kernel-level stuffs for my firewall. any ideas on that?
|
|
|
|