|
Hi all,
Actually i want to write a html file or .html page and i don't know how to do it using MFC. I know how to write a .txt file using CStdioFile class and using WriteString API's. Can any body tell me how to do it.
Thanks in advance
|
|
|
|
|
1. You must know the HTML tags.
2. While saving the file just specify the extension as .htm / .html.
And you are done with writing an .html file.
Regards,
Paresh.
|
|
|
|
|
|
Hi all
I ahev problem, I have code:
<br />
HANDLE hSearch = INVALID_HANDLE_VALUE; <br />
WIN32_FIND_DATA FileData; <br />
<br />
<br />
if(hSearch == INVALID_HANDLE_VALUE) <br />
hSearch = FindFirstFile("C:\\Myfolder\\Fi*",&FileData);
else<br />
FindNextFileA(Search,&FileData);<br />
<br />
when program go to "problem point" I get error message: NTDLL.dll
|
|
|
|
|
david bagaturia wrote: when program go to "problem point" I get error message: NTDLL.dll
NTDLL.dll ? That's a very descriptive error message
If you want some help, you have to provide at least some bit of usefull information. So, what happens exactly ? What does this message say exactly ?
|
|
|
|
|
I get this error: unhandled exception in cpy_file.exe (KERNEL32.dll):
0xE06D7363: Microsoft C++ Exception.
|
|
|
|
|
Use your debugger to inspect the variables and see exactly what happens.
|
|
|
|
|
My windows have some problems.
I restart My PC and now this code works good.
thanks for help.
|
|
|
|
|
Hi, I have two question.
First is how I can set bigger font to my list control, i get the font using
CFont* myFont = my_List.GetFont(); , can I use this font to enlarge it and than set it back?
And the second question is how to set background color to an a dialog?
Thanks!
|
|
|
|
|
josip cagalj wrote: how I can set bigger font to my list control,
You can create font object (member variable) and use SetFont() API of ListCtrl
josip cagalj wrote: how to set background color to an a dialog
Map the WM_CTLCOLOR and write,
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if( nCtlColor == CTLCOLOR_DLG )
{
hbr = (HBRUSH) GetStockObject( BLACK_BRUSH ); // or m_brushDlg.GetSafeHandle();
}
return hbr;
- NS -
|
|
|
|
|
Thanks for replay.
I do this:
<br />
CDC *pDC=GetDC();<br />
CFont VelikiFont;<br />
int nHeight;<br />
nHeight = -MulDiv(10, pDC->GetDeviceCaps(LOGPIXELSY), 72);<br />
VelikiFont.CreateFont(<br />
nHeight,
0,
0,
0,
FW_BOLD,
FALSE,
FALSE,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
PROOF_QUALITY,
FIXED_PITCH | FF_MODERN,
"Courier New"
);<br />
<br />
ReleaseDC(pDC);<br />
m_List.SetFont(&VelikiFont);
But I dont get what I wont. When I change 'nHeight' parameter I don't get bigger font, but more space between rows!
Regarding background color Can I set the color (like RGB value or something) instead of choosing type of stock object!
Once again thanks for replaying!
|
|
|
|
|
josip cagalj wrote: CFont VelikiFont;
Font object should be member or global. That is it should not be local.
josip cagalj wrote: Regarding background color Can I set the color (like RGB value or something) instead of choosing type of stock object!
In my sample I have placed a comment regarding this.
You have to keep a brush as member or global.
- NS -
|
|
|
|
|
How to put different text color only for one item?
I need this because I'll put different color on item text when mouse is over item!My list control has only one column.
Thanks
|
|
|
|
|
Hi
I want to Read data from the Folder and to write the same data in to another Folder.
I create the Folder as "CreateDirectory(L"c:\\mydirectory", NULL);"
Give your suggestion to Reading and Writing the data from Folder.
Regards
shakumar
-- modified at 7:26 Monday 10th September, 2007
shakumar
|
|
|
|
|
CFindFile will be useful
- NS -
|
|
|
|
|
shakumar_22 wrote: Give your suggestion to Reading and Writing the data from Folder.
There are a lot of ways, including STL streams, MFC classes such as CFile and CStdioFile , and the Win32 functions like Read() and Write() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi
I have code that will help
if you whont I will send you code
and comment.
|
|
|
|
|
Hello Friends,
Currently in free time i was just checking the C#.Net. and when I try to make the sample porject in C# in Visual Studio 2005 I amazed by the IntelliSense.It works so fast and nicely in C# but it doesnt working in the same manner when I am working on Win32 programming. Is there any way i can change the IntelliSense to work better.
|
|
|
|
|
Hi,
i think no. But you can set some preferences into the Settings-Menu of VS2005.
Propably some checkboxes de-/activates some specials which takes more time
Greetings
|
|
|
|
|
Hello,
I need the answers for the following questions:
1. I have a class (ex: Test) contains 2 variables,then I am creating 2 objects of that class. How many copies of the variables are stored in memory?
2. What will be the output of the following program:
int* fun()
{
int a;
return &a;
}
suppose, if i assign a value for the variable "a" (ie int a=10) what will be the output?
Thanks in advance for the solutions.
|
|
|
|
|
1) two: one copy for each object. Do you want one common object for every class? Then you have to use a static variable.
2) it returns the address of the variable 'a'...it is not important what it contains (10 , 20 or 0). You can look at the contents of (&a) with *( &a )
Russell
|
|
|
|
|
Suspiciously homeworky
I reckon you can multiply 1 by 2 so on to the second part. The a varaible is a local varibale in the function you have written. This along with the way it's declared mean that it ends up on the stack. If you think what happens to the stack for this function when execution leaves the function then you'll understand what returning &a will give you. If the stack means nothing to you then you've discovered the point of the exercise. If you're into full on low level code and just not familiar with C++ then I'd recommend debugging through the example you posted in the disassembly window.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
rajaratk wrote: int* fun()
{
int a;
return &a;
}
bad function: you can't use the address of a local variable, 'a' is destroyed when the function ends, so *fun() can return a number different from 10 (in your example)
Russell
|
|
|
|
|
Russell` wrote: you can't use the address of a local variable,
You can, but the value gained us useless, thats the pitty!
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
So, finally, it is the same of "you can't use it".
Do you agree?
Russell
|
|
|
|