|
Anonymous wrote:
This was an exercise to learn to create an application window. Here is the code, a very short program.
But this isn't the file in which you were getting a compilation error, is it? You said the error was "error C2146: syntax error : missing ';' before identifier 'HwndMSWheel'" and I can't see HwndMSWheel anywhere in the code you posted...
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
How about:
COurWnd::COurWnd()
{
}
BOOL COurApp::InitInstance(void)
{
COurWnd *pMainWnd = new COurWnd;
m_pMainWnd = pMainWnd;
pMainWnd->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW, NULL, NULL);
pMainWnd->ShowWindow(m_nCmdShow);
pMainWnd->UpdateWindow();
return TRUE;
}
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi there...
I've been trying to print some graphics done with gdi+..
ForExample:
Graphics graphics(pDC->m_hDC);<br />
graphics.FillRectangle(&(SolidBrush(Color(255,2,90,50))),10,10,400,300);<br />
graphics.FillEllipse(&(SolidBrush(Color(100,255,255,100))),10,10,300,300);
On my screen it looks exactly like want it to...but when i'm trying to print it on our
HP1050C Plotter the alpha transparent areas were opaque..
Does anyone know this problem??
|
|
|
|
|
Probably a driver issue. Try drawing to a memory bitmap, then blitting this to the printer DC (assuming the printer driver supports blitting).
---------------------------------------- the ocean is full because everyone's crying
|
|
|
|
|
Yes, it's probably a driver issue...
But this just a little demo i wrote... actual i tested it for our GIS-Software...
and there i can't just draw it into a membitmap...the memory would blow up^^
btw. pls. excuse my bad english...)
|
|
|
|
|
Hi all,
I am using MS flex grid to show my application data. There is a point when I need to Input from the user so that I can proceed the working. What I am doing is I have placed an edit box control at design time. Then I get pointer to it using GetDlgItem. and then I am calling SetWindowPos function to display it on a specific cell of the grid. But the edit box do not get displayed.
My code looks like:
CEdit *m_pEditValue = (CEdit*) GetDlgItem(IDC_EDIT_VALUE);
m_pEditValue->SetWindowText("Displayed");
m_pEditValue->SetWindowPos(&wndTop,m_flexgrid.GetCellLeft(),m_flexgrid.GetCellTop(),m_flexgrid.GetCellWidth(),m_flexgrid.GetCellHeight(),SWP_SHOWWINDOW);
The program does not give any error but It does not show the edit box. I think it is behind the grid and that means &wndTop is not making it a topmost window.
Any suggestion please ?
Thanx in advance.
Ritu Kwatra
|
|
|
|
|
hi
i have used:
FILE *new = fopen("bla.txt","r+");
to edit a file that i have created earlier.
i need now to delete the last line in the file and add a new one.
How can i do that without overwriting the old line?
/\|-||\/|/\|)
|
|
|
|
|
Halawlaws wrote:
i need now to delete the last line in the file and add a new one.
How can i do that without overwriting the old line?
These two requirements contradict each other. Deleting a line and replacing it with another is the same as overwriting.
If the old and new lines are the same length, just use fseek() to position the file pointer to the beginning of the line. Otherwise, you'll need to read each line in the file into a temporary file sans the last line. Write the new line to the temporary file. Close both files. Delete the original file. Rename the temporary file. Make sense?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
hey
I can't use fseek coz they have different size so i will try the second method only how can i delete the original file and rename the temporary one.
What functions do i use?
/\|-||\/|/\|)
|
|
|
|
|
Halawlaws wrote:
...how can i delete the original file and rename the temporary one.
What functions do i use?
remove() and rename() come to mind.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thx for ur help man but take it easy I am not an expert
/\|-||\/|/\|)
|
|
|
|
|
How can i get application path?
|
|
|
|
|
|
Hello
You can extract it from module file name (GetModuleFileName ).
Andrew
|
|
|
|
|
<br />
char BufferApplicationFile[MAX_PATH] = {0};<br />
if (GetModuleFileName(AfxGetInstanceHandle(), BufferApplicationFile, MAX_PATH) == 0) {<br />
}<br />
|
|
|
|
|
abd.Eskandari wrote: How can i get application path?
TCHAR str[MAX_PATH];
GetModuleFileName(NULL,str,MAX_PATH);
OutputDebugString(str);
TCHAR szFileName[MAX_PATH];
_splitpath(str,NULL,NULL,szFileName,NULL);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
[CODE]http://img301.imageshack.us/img301/5328/closewait0lw.jpg[/CODE]
1. what does "close wait" means?
2. what does "fin_wait2" means?
i understand that these are socket status but
- what do they mean? the socket is waiting for server? the socket is shutting down but waiting for certain event to happen before it's allowed to shutdown?
- what situations causes them?
- it seems that the socket is waiting for something, how can i stop the close wait/fin_wait2 and shutdown the socket? (gracefully or forcefully)
it seems that sockets on "close wait" and "fin_wait2" on my program are the ones with problems
please advise
|
|
|
|
|
Hi
I do have a dialog with a spinner control which is "connected" to an edit box. That edit box is a "number" so the user can not enter any non-digit characters.
Now I click the edit box, enter the number "55555" and then press the up-button of the spinner control. The result (unfortunately) is, that the number is not "55556" but "55.556" (notice the dot in there).
How can I prevent the spinner control from inserting any dots in the number-text?!?
Thanks & Bye,
T.T.H.
P.S.: I coding an MFC v7.1 application with MS Visual Studio.NET 2003 v7.1.3088 on a German WindowsXP - my problem could be caused by the German number convention (e.x. "12.345.678,90") which I do NOT want to be used in any way in my application.
|
|
|
|
|
T.T.H. wrote:
How can I prevent the spinner control from inserting any dots in the number-text?!?
There's a UDS_NOTHOUSANDS style that you can use for that. In the dialog properties editor, it shows as "No Thousands".
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Check the properties of the control (within the resource editor).
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thank you so much guys!
Sometimes I just need a nudge in the right direction
|
|
|
|
|
|
Hi there,
I'm trying to use a CImage in order to display some images in a window. I can easily load an image with Load() method, but what I want now is to create a (w x h) image (easy) and fill it with a color. How can I do this? I tried to use the following:
<br />
for (int x=0; x < width; ++x)<br />
for (int y=0; y < height; ++y)<br />
img.SetPixel(x,y,RGB(...));<br />
But of course, as I expected, it takes quite a few seconds to fill the image. Is there any faster way?
Thanks,
Themis
|
|
|
|
|
Can you get the HBITMAP of the image and put it in a HDC ? Then you can fill it all in one go.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|