|
yes i have debugged, iam getting all the variables are in correct manner.
|
|
|
|
|
Windows is event driven (well, message driven...): drawing should happen inside the WM_PAINT message handler, that is CDialog::OnPaint method for an MFC application.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
I'm using CStdioFile to read a file line by line, I want to delete line 5,6,9 from the file.
Plz give me hint or soln..
thax
|
|
|
|
|
You can either write the lines to another file without writing the lines you want to delete.
Then delete the original and rename the new file with the original name.
Or you could store all the required lines in memory and overwrite the original file.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
me sathish
first take the contents of the file using FILE* like c funtions
gradually turn to next line ,meanwhile to store a static value if the pointer goes to downwards if reached 456 write " " ie empty text there ...
ya
|
|
|
|
|
sathish / satheesh,
You need to reply to the original poster, not the helper. The original poster will be more interested in your assistance.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
me carlo
go straight forward until you reach the first crossroad with traffic lights, then turn left and straight forward to the next crossroad with traffic lights where you will take the left turn and then make a turn on first available street on your right. Go straight forward down the street and at the end, on your right you'll see the hotel.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Makes perfect sense to me, although I question why you opted to turn down that one street.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
is there an easy way to hide/show nodes in a mfc ctreectrl?
i need to create a function that does this, but all i could come with is deleting and inserting a node to hide and show it.
but this would be a problem especially since i have to know the order of the nodes.
thanks
|
|
|
|
|
I think you need to delete and insert them again.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I can confirm Hamid's opinion. I've looked at the possible item states, and there isn't a TVIS_STEALTH option, or any other equivalent that I can see.
But you can always keep a copy of the information you created the tree from and work with that and add / remove the nodes from the tree.
Sorry, but I don;t see any alternative to you rolling your sleeves up and typing.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
I crreate two MFC DLL projects for 3ds max plugin.
Frist project is called maxCameraPathMFC ,which call the fDoExport function of maxCameraPathExporterMFC (second project).
int maxCameraPathMFC::DoExport(const TCHAR* name,ExpInterface* ei,Interface* i, BOOL suppressPrompts, DWORD options)
{
typedef int (CALLBACK* D_MYEXPORT)(const TCHAR*,ExpInterface*,Interface*,BOOL,DWORD);
HMODULE l_mod;
D_MYEXPORT l_export=NULL;
int l_ret=0;
l_mod=LoadLibrary("plugins_akira\\2\\maxCameraPathExporterMFC.dle");
if (l_mod!=NULL)
{
l_export=(D_MYEXPORT)GetProcAddress(l_mod,"fDoExport");
l_ret=l_export(name,ei,i,suppressPrompts,options);
FreeLibrary(l_mod);
}
return TRUE;
}
Second project is called maxCameraPathExporterMFC,which is based on KW X-port source code. The project's fDoExport function calls the IGamExporter's DoExport as below:
int __stdcall
fDoExport(const TCHAR *name,
ExpInterface *ei,
Interface *i,
BOOL suppressPrompts,
DWORD options)
{
if(!suppressPrompts)
{
{
IGameExporter* pIGameExporter=new IGameExporter();
pIGameExporter->DoExport(name,ei,i,suppressPrompts,options);
delete pIGameExporter;
}
}
return TRUE;
}
I export XFile by first project's dll, and then call the second project's fDoExport. The XFile is really exported successfully. But when I close the 3ds max, it appears an error message of Unhandle exception (http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/3ds%20max%20two%20%20plugin%20error%20Q2.JPG).
Colud somebody tell how to solve this probolem?
I put the complete source code at the web (http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/maxCameraPathQ2.rar)
|
|
|
|
|
Hello,
I am using CRecordset to access MSSQL database. I use CString to bind
the varchar datatype.
When a empty string is assigned to the CString variable and update,
the length is not correct.
The following steps can repeat the problem:
1. Assign the varchar field to "AAA"
2. Assign the CString variable to "" and then call update()
3. In Query analyzer, len() returns 3 instead of 0.
When retrieve the value and compare against '' (empty string) in ASP
code, it returns false.
Please help. Thanks.
Regards,
HM
|
|
|
|
|
Does anyone Know if there is a ON_MESSAGE macro for sending messages to Dialog box as the ON_MESSAGE looks for Cwnd *
Tnakx
|
|
|
|
|
CDialog inherits CWnd, so I don't understand your question.
Could you provide some details regarding your problem?
|
|
|
|
|
I download Popupdemo from this site after building it I got the Following compile errors
1>.\PopupDemoDlg.cpp(88) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CPopupDemoDlg::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
1> None of the functions with this name in scope match the target type
1>.\PopupDemoDlg.cpp(89) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CPopupDemoDlg::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
1> None of the functions with this name in scope match the target type
The cause of this seems to be
The Message map macro
BEGIN_MESSAGE_MAP(CPopupDemoDlg, CDialog)
//{{AFX_MSG_MAP(CPopupDemoDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_MESSAGE(ID_MENU_SELECTALL, OnSelectAll) <---
ON_MESSAGE(ID_MENU_COPY, OnCopy) <---
Point to functions OnSelectAll, and Oncopy Which are members CpopupDemoDlg which is a CDialog type
Which in a way makes sense since you do a SendMessage typically to a Cwnd not a Cdialog
was just wondering if there was a way around this error
thankx
|
|
|
|
|
can you give a link to the article you downloaded this from?
|
|
|
|
|
//www.codeproject.com/KB/edit/popupdemo.aspx
The Code Doesn't compile I basically was looking for Code on how to Create a CRichEditCtrl object
If I have it ( the Rich Edit Control ) defined in my resource member
thankx
|
|
|
|
|
Change ON_MESSAGE to ON_COMMAND
That fixes the compile errors.
EDIT:
Pay no attention to my answer, Stuart's answer below is much better, and most likely works!
|
|
|
|
|
Richard Andrew x64 wrote: That fixes the compile errors.
But stops the application working - the context menu IDs are actually sent to the application as window messages, using PostMessage, rather than as commands.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
yeap tried that the oncopy onselect dont seem to be menu commands
|
|
|
|
|
No, they're not - they're sent as window messages. Change the OnCopy and OnSelectAll signatures as per my other post and you'll be good. Trust me - I built & tested the demo with those changes
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
A CDialog derives from CWnd - that part of the error message is a red herring.
The trouble is that the code uses the wrong signatures for the OnSelectAll and OnCopy handlers. This didn't matter on VC6, as the C++ compiler was less discriminating than it is now, but on VC++2003 and later, the compiler will (correctly) tell you that that you're trying to cast a method pointer to an incompatible method pointer (because that's what OnCopy/OnSelectAll are in the ON_MESSAGE macro).
I can understand why the original author had those signatures (menu commands are usually handled with ON_COMMAND, but the way he's handled the context menu, they have to be handled with ON_MESSAGE here).
Anyway, change OnCopy and OnSelectAll declaration and definition so they a) return an LRESULT, and b) take a WPARAM and an LPARAM parameter and you'll be sorted. As an example, OnSelectAll should look like this in your class definition:
LRESULT OnCopy(WPARAM, LPARAM);
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I added return of TRUE;
e.g. return TRUE; to both methods
thankx again
|
|
|
|
|
I'm working on a straight C program in Visual Studio 6.0.
I added a few calls to malloc() today, and malloc fails every time with a NULL return value. GetLastError() returns 998 - Invalid access to memory location.
The process is using only about 5 MB of RAM when this occurs, and I've restarted XP several times without curing the problem.
No other process on the system shows any signs of running out of memory.
When I replace calls to malloc with calls to HeapAlloc(), the program runs fine.
Can anyone think of a reason why malloc might be failing?
|
|
|
|