|
Hi Friends
I created an MFC Application using AppWizard with the option "Split Window"(something like this) in the 4th step's advanced section. It splits the window dynamically.
Can I make this dynamic splitting static ??
by calling 'CreateStatic' instead of 'Create' in CFrameWnd::OnCreateClient
i.e
BOOL CmyMain::OnCreateClient( 'parameters' )
{
// creating splitter
m_wndSplitter.CreateStatic(this,
1 // one row
2 // two columns
)
return TRUE;
}
Will it solve my problem or i need the other stuffs ??
If YES the please identify them also
BTW Do I need to create view for each splitted window ??
you can reply me at aatifaqeel@yahoo.com
Thanx for helping me
|
|
|
|
|
Which API should be the best choice (i.e winsock2 e.t.c) for the development of a firewall (in MFC) for a beginner.
Reply me soon
|
|
|
|
|
I am interested in developing a firewall using VC++(MFC). pLZ TELL ME WHAT LIBRARIES/websites to explore and how to start. I am a beginner so plz guide me properly in detail.
Reply me soon
|
|
|
|
|
http://www.codeproject.com/useritems/DrvFltIp.asp for a start
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hy people!
My CRichEditCtrl is taking me out of control... I don't know what to do...
It haves an CString variable and a control variable associate. When I type more than 256 chars, it just crash...
If someone have some idea...
thanks all for the attention.
cheers!
Ricky
|
|
|
|
|
I just tested this with a RichEditCtrl using a control and text variable mapped to it using the DDX_COntrol and DDX_Text functions, and couldn't reproduce the problem. Are you doing anything special in the EN_CHANGE handler or anything else?
Could you also run in debug mode and get the line of the crash and a stack trace, as that may help pinpoint the problem.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
Yes Roger, I found the problem...
I'm using SendMessage(EM_SETEVENTMASK, (WPARAM)NULL, (LPARAM)ENM_UPDATE), just to count the number of chars.
The problem was in the CString variables that was associate with the control. I delete them, and used GetWindowText instead of UpdateData(); and works fine.
Thanks for your help!
cheers!
Ricky
|
|
|
|
|
Can I use CPaintDC outside OnDraw() and other related functions ? And if so, how ?
This is because I have a big problem: When I draw objects using CClientDC they appear on a screen location (inside the client's area) different from when I use CPaintDC, in the OnDraw() routine because of the Invalidate() message....
What is going on ?
Thank you
|
|
|
|
|
In CView::OnDraw you don't need CPaintDC and CClientDC. You have CDC* parameter:
void CMyView::OnDraw(CDC* pDC)
{
pDC->...
}
|
|
|
|
|
Yes, I know. I explainied my problem wrong:
I call the OnDraw() routine when I need to repaint the client area. But when I need a device context in other routines, like OnMouseMove(), I create a CClientDC device context. The problem arouses when I move the ViewPort. I don not know why, but the CPaintDC device context already knows this, whereas the CClientDC does not.
So, whenever I scroll and then draw something with the mouse I get the objects I drew in a position. But when I redraw the whole client area the objects change position....
Thank you
|
|
|
|
|
The general approach is drawing only in one place - OnDraw (or OnPaint, if class is not CView). Drawing from any other places is overwritten by OnDraw, in any case. In mouse message handler you make the changes in drawing objects (for example, change some variables in CDocument) and invalidate the view or part of it.
|
|
|
|
|
I agree with you, but in this case I need to draw outside the OnDraw() or OnPaint(), although I a have a CView class. I solved the problem by writing a clone of OnPrepareDC for a CClientDC device context type, and use before I use the CClientDC class.
By the way, how does one do to invalidade only part of the client area ?
Thank you for your time and patience
|
|
|
|
|
InvalidateRect ?
BOOL InvalidateRect(
HWND hWnd, // handle to window
CONST RECT* lpRect, // rectangle coordinates
BOOL bErase // erase state
);
It was always there.
|
|
|
|
|
Yes it was !!! Thanks
|
|
|
|
|
I have a CHeaderCtrl with icons in some of the columns. When I resize the columns and make it smaller the divider partly overwrites the icon. It appears to be 6 extra blank pixels on each side of the divider. Is it possible to make that smaller.
Thanks for help
|
|
|
|
|
Hi,
I am trying to create a small filepacker for a game. I am using the ZipArchive library from http://www.artpol-software.com/index_zip.html, which is very nice. I've played around and got it working well, but so far I can only extract files to the hard-drive.
What I want to do is this: extract all necessary files from the zip into memory, and then launch the executable (which relies on other files) from the memory. When the game is finished, obviously it will all have to be deleted from memory. I want to do this as it is more "secure" (relatively speaking) than extracting the files to the hard-disk (where anyone can grab them) and then deleting them.
Is this possible? And if so, how do I go about it? Will it slow things down doing it this way? Any advice or information about how to go about this (or where to look for good tutorials on this sort of thing) would be really appreciated.
Many thanks,
KB
|
|
|
|
|
i will suggest you to apply some routine to search the .exe file after you open the zip file. then you can apply shellexecute() function to run that file. this is the best way as i can think of this time..
cheers
Himanshu
|
|
|
|
|
Hi Friends,
I want to give database support for an existing project in vc, so, I inserted one more class whose base class is CRecordSet and gave the the ODBC connectivity to that. When I compiled the project I got the error CRecordset base class undefined and followed by some more errors. I included the <afxdb.h> in my stdafx.h, still I am finding the same errors. Can any body help me, please.
Thank u in advance.
Satya
|
|
|
|
|
We need more info:
1. What are the errors?
2. What are the lines with the errors?
3. You say you included ??? in stdafx.h, was it afxdb.h?
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Hi,
Sorry for not putting the header file name. U r right its afxdb.h.
Here are the errors
e:\trail\lan_wan\myrecordset2.h(14) : error C2504: 'CRecordset' : base class undefined
e:\trail\lan_wan\myrecordset2.h(16) : error C2629: unexpected 'class CMyRecordSet ('
e:\trail\lan_wan\myrecordset2.h(16) : error C2238: unexpected token(s) preceding ';'
e:\trail\lan_wan\myrecordset2.h(46) : error C2061: syntax error : identifier 'CFieldExchange'
E:\Trail\Lan_Wan\MyRecordSet2.cpp(17) : error C2653: 'CRecordset' : is not a class or namespace name
E:\Trail\Lan_Wan\MyRecordSet2.cpp(17) : error C2065: 'classCRecordset' : undeclared identifier
E:\Trail\Lan_Wan\MyRecordSet2.cpp(19) : error C2065: 'CDatabase' : undeclared identifier
E:\Trail\Lan_Wan\MyRecordSet2.cpp(19) : error C2065: 'pdb' : undeclared identifier
E:\Trail\Lan_Wan\MyRecordSet2.cpp(20) : error C2448: '<unknown>' : function-style initializer appears to be a function definition
E:\Trail\Lan_Wan\MyRecordSet2.cpp(20) : error C2143: syntax error : missing ';' before ':'
E:\Trail\Lan_Wan\MyRecordSet2.cpp(21) : error C2448: '<unknown>' : function-style initializer appears to be a function definition
E:\Trail\Lan_Wan\MyRecordSet2.cpp(55) : error C2065: 'CFieldExchange' : undeclared identifier
E:\Trail\Lan_Wan\MyRecordSet2.cpp(55) : error C2065: 'pFX' : undeclared identifier
E:\Trail\Lan_Wan\MyRecordSet2.cpp(56) : error C2448: '<unknown>' : function-style initializer appears to be a function definition
E:\Trail\Lan_Wan\MyRecordSet2.cpp(84) : error C2653: 'CRecordset' : is not a class or namespace name
E:\Trail\Lan_Wan\MyRecordSet2.cpp(89) : error C2653: 'CRecordset' : is not a class or namespace name
These errors are coming before including the header file and after header file, I don't know what to do.
regards,
satya
|
|
|
|
|
Simple question for a simple answer...
Can I write a HLP file with VC6? (from AppWizard for example)
Tell me how?
Thanks in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
I have done this in the past by editing the afxcore.rtf and afxprint.rtf files manually in either notepad or Visual studio (make sure you open the files as text, not auto). Once you have made changes, you can rebuild your helpfile using help workshop.
Helpworkshop can be found under VS ^.0 -> Tools->Help workshop in your start menu. Use it to open your projects .hpj file.
If your doing this for a MFC project, I would recommend switching to the afxcore/afxprint.rtf files listed in one of my articles here in the help section, as they are far less compicated and much easier to understand. From that point, you should be able to add your own .rtf files and topics to the help project.
If you need any more tips, e-mail me direct.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
Thanks for the help... I go to understand a bit more the "Help Workshop" first... but it seems simple...
Thanks
Hello World!!!
from Raphaël
|
|
|
|
|
hello @all,
i try to explain what i want / must do:
i have something like this:
<br />
int i=0;<br />
while(i<5)<br />
{<br />
i++;<br />
}<br />
the only problem is the while loop. without these, the program part runs perfectly. however i need a while loop or something like that.
i think, the problem lie in the fact that the program sends the data to matlab and then directly in the code continues to go. possibly different processes run off parallel.
i think i must have something that waits so long, till matlab is ready with the diagram (i tried Sleep(1000) but it do not work).
maybe somebody know, if matlab has got a 'instruction' or if i can make something like a 'queue'.
thank you very much
sunny
|
|
|
|
|
hi,
have you tried using for loop too. i guess you would have.I don't think two processes can be running in parellel bcz you are calling your diagram from MATLAB then when it's dissolved then only the program execution will continue. that means there is something else wrong.
I will suggest debugging the program step by step by putting a breakpoint just before the loop and then f10 or f11. i guess u know all that. how to debug. I guess you will reach a solution then.
cheers..
Himanshu
|
|
|
|