|
Hi all,
I am using Embedded Visual C++ 3.0 and MFC dialog mode for implementation. Firstly, if I want to read one line each time from a .txt file in Pocket PC, can I use the following code?
char* data;
data = NULL;
fp=fopen("\\sip.txt","r");
while((!feof(fp)) && (fp != NULL))
{
fscanf(fp, "%s", data);
// Process the data here
}
fclose(fp);
Then, if I want to get the typed message from an edit box in a MFC dialog box and write/ append it into the file each time a line, should I do this?
CString asip;
GetDlgItemText(INPUT_ASIP, asip);
fp=fopen("\\sip.txt","a");
fprintf(fp, "%s\n", asip);
fclose(fp);
But I encounter a problem that the output file “sip” contains only the first character of the CString asip. How can I solve this?
It’s really urgent as I have to hand the program before 26/3/2003 so please kindly help me.
Many thanks!!!
Wil
|
|
|
|
|
The ICM 2.0 documentation seems to indicate that ICM can work with any valid ICC color profile. These profiles can specify non-sRGB color spaces, such as CMYK and CIE LAB. Does anyone know if it's actually possible to use Windows color management to work in CIE LAB space or CMYK space?
This is relevant because I am really interested in being able to print to my printer's complete color gamut, not only the part that overlaps with sRGB. (The default sRGB color space that windows uses is really lousy at representing saturated yellow, orange, and cyan colors that standard printers can represent very nicely).
|
|
|
|
|
I created Edit, Combo, Button, Calendar, Tab, Main Window... but all of them have similar problem: Captions (Window Text) of all Control written by BOLD font >> Weight = 700
>> I want to SET FONT for all control back to NOT BOLD >> Weight = 100 (THIN)
I have a solution: use CreateFont() with para Weight=100 then SelectObject(ControlDC, CreatedFont) then write Caption (Window Text) in to its DC but this way seem too long...
Can you have a short way ?
Help me please....
thanks alot
I use non-MFC programming
|
|
|
|
|
If you're not using MFC, there may not be another solution. Are you using C++ ( as opposed to C ) ? If so, you should encapsulate the behaviour of setting a font into a class and use that class to create edit box instances.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
hi
i'm just a newb to vc++ and the articles on this site were kind very unclear. i created a dialog app with the mfc appwizard. created a button on the dialog to open the modeless window.
an example of the code.
void CMyAppDlg::OnHitMe()
{
// TODO: Add your control notification handler code here
// Display the modal dialog box
pdlg = new CNoteDlg;
pdlg->Create(IDD_NOTEDLG,this);
}
i have the private:
CNoteDlg * pdlg;
in my myappdlg.h
and my dialog resource is named IDD_NOTEDLG
and myappdlg.h #include's notedlg.h i've been fiddling with this for a while and its really confusing. if anyone can give some assistance it is appreciated
|
|
|
|
|
You need to also make the dialog visible (this is not automatic for modeless dialogs). Either set the Visible style in the resource editor, or add this after the Create() call
pdlg->ShowWindow ( SW_SHOW );
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"Which comes first, the bug or the stress?" -- Chris Maunder
|
|
|
|
|
and don't forget to delete this in the PostNcDestroy notification in the modeless dialog
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
adding that gives me this error when i build & run:
Debug Assertion Failed!
Prgram :...\yadayadayada\myapp.exe
File: winocc.cpp
Line: 301
|
|
|
|
|
Instead of pdlg->Create(IDD_NOTEDLG,this);
try
pdlg->Create(CNoteDlg::IDD);
And check if (pdlg != NULL) .
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
well the code now looks like this and i still get that assert debug error and the window still doesnt show:
void CMyAppDlg::OnHitMe()
{
// TODO: Add your control notification handler code here
// Display the modal dialog box
pdlg = new CNoteDlg(this);
if (pdlg != NULL){
pdlg->Create(CNoteDlg::IDD);
pdlg->ShowWindow(SW_SHOW);
}
else
{
AfxMessageBox("Error");
}
}
however just recently i decided to try debugging, and i was looking through and i get an error of "this CXX0017:Error: symbol "this" not found
i appreciate your help
|
|
|
|
|
I'm sorry I don't know what's wrong with the code. That's an excerpt from the code from one of my apps:
playerDlg = new CPlayersDlg(this);
playerDlg->Create(CPlayersDlg::IDD);
if(playerDlg != NULL)
playerDlg->ShowWindow(SW_SHOW);
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi
Does anybody knows how can I remove the close, maximize and minimize buttons from a dialogduring runtime?
(I use the doc/view configuration in my project)
|
|
|
|
|
Use ModifyStyle() !
A. Riazi
|
|
|
|
|
You can use SetWindowLong.
SetWindowLong(this->m_hWnd,GWL_STYLE,
GetWindowLong(this->m_hWnd,GWL_STYLE) |
WS_MINIMIZEBOX | WS_MAXIMIZEBOX);
That code would add the minimize and maximize box.
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
I want to create a simple window using MFC (non Doc/View app). I am using AfxRegisterWndClass() to create a window of my own class. Can anyone tell me that how can i change the name of my window class ???
|
|
|
|
|
|
how can i know if the sheet contains charts or graphs ??
I tried to call _Worksheet::ChartObjects(1) but I got error..
Can someone help me please.
my program is an excel automation.
thank you
|
|
|
|
|
Hi there,
I am searching a program which shows which files are used by my program. I know dependencytracker but it is a bit complicated for me. So is there a simple prog to find out? I am searching this to run my app in another machine...
Thanx for reading...
|
|
|
|
|
|
How can I determine CPU USage in WinXP?
|
|
|
|
|
CTRL-ALT-DEL -> Task Manager button -> Performance tab
|
|
|
|
|
|
Can someone tell me how to make my program switch between monitors, i.e. make a new monitor the active one? Also how do I split one monitor into two spaces, then swap between them. I would think all this is related. Splitting up the desktop, then activating a part of it.
chris
|
|
|
|
|
|
Can I block keyboard events such as keypress or key down of any key in a program?
The program will be controlled by a mouse only.
Thanks
JW
DJ
|
|
|
|