|
Hi All,
I am working on a dialog which have several controls and an Ultimate Grid
(UG is invoked from OnInitDialog m_TestGrid.AttachGrid(this, IDC_STATIC);).
When i use the "Test Dialog", The tabstops work as i defined.
But when i compile the code and run the dialog, Tab Stops dont work.
The tabstop works only when i switch between 2 controls(Ex: stop 7 and 8).
Can anyone give me some inputs on this.
Kasi
|
|
|
|
|
Hi,
I am having the follwoing CString "0000122334" and I need to remove the starting zeros from the string.
Kindly help.
Thanks in Advance.
|
|
|
|
|
Probably something like this[^].
The best things in life are not things.
|
|
|
|
|
Use The method CString::Remove like thish
CString TempString("0000122334");
TempString.Remove('0');
|
|
|
|
|
Try using CString::TrimLeft() to remove leading characters (see documentation in MSDN), CString::Remove() will remove all instances and not just the leading zeros.
|
|
|
|
|
here there are two method.
method 1: if your string is numeric then first convert into integer and again change into string.
eg. CString cs("000012345745");
int num = atoi(cs);
cs.Format("%d",num);
method 2:
eg. CString cs("000012345745");
cs.Trim();
int start=0;
while(cs.Mid(start,1)=="0")
{
start++;
}
cs= cs.Mid(start);
|
|
|
|
|
My MSAA Hook dll is expected to be loaded into all process's memory. in 32 bits Win7 it works.
But in win7 64 bits some process can load MSAAHook.dll 64 bits cannot be loaded into some 64 bits process. Why does this happens?
= ::SetWinEventHook(EVENT_MIN,
EVENT_MAX,
m_hModule,
MSAAHook::WinEventProc,
0,
0,
WINEVENT_INCONTEXT | WINEVENT_SKIPOWNTHREAD);
|
|
|
|
|
Currently, "exiting" (pressing upper right-hand corner's "X") WMP closes the WMP window but allows WMP sound to continue. How can this WMP "exiting\termination" event be caught or trapped programmatically so as to enable clean and thorough shutdown of Windows Media Player? Can the WMP ATL's OnOpenStateChange possess a Dispatch Identifier (known as DISP) that can catch this closure and termination event?
Thank you.
Michael A. Rinaldi
|
|
|
|
|
I converted old C++ project to VS.Net 2010 with 4.0 Framework.
error C2440: 'static_cast' : cannot convert from 'void (__thiscall CChatView::* )(WPARAM,LPARAM)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
ON_MESSAGE(WM_ChatAddSize, OnChatAddSize)
void CChatView::OnChatAddSize(LPARAM lParam, WPARAM wParam)
afx_msg void OnChatAddSize(LPARAM lParam, WPARAM wParam);
Help would be really appreciated.
Thanks
|
|
|
|
|
You have your WPARAM and LPARAM in the wrong order, and your return types don't match; read the error message, it contains pearls of wisdom.
The best things in life are not things.
|
|
|
|
|
that's right, they are not related pointer type.
|
|
|
|
|
Studio has gotten a lot more picky about this (and they should've been all along) but essentially what the error is telling you.
You defined a message catching method as:
afx_msg void OnChatAddSize(LPARAM lParam, WPARAM wParam);
but it expected (for ON_MESSAGE() ) a method call that would look like this:
afx_msg LRESULT OnChatAddSize(WPARAM wParam, LPARAM lParam)
So you essentially have to have the parameters be of the same type and order (WPARAM, LPARAM) and have return of type LRESULT and you'll make the compiler happy.
|
|
|
|
|
Hi i need code for displaying the utf8 text through mfc application.Please any one help me in this regard.
Regards
Kishore Kumar Dacha
|
|
|
|
|
Where do you want to display it? One of the printf() [^] or TextOut() [^] type routines should be able to handle it.
The best things in life are not things.
|
|
|
|
|
Hello,
I have a Windows Application with its own PlugIn-System. Each PlugIn is a typical Windows-Dll. All works fine so far.
The problem is that if a single PlugIn (for whatever reason) crashes, the whole application crashes too.
Its the same problem as FireFox and Flash-PlugIn, for example.
I wonder if someone has any idea how to catch such crashes in order to prevent the crashing of the main application.
Calling the PlugIn-Dll Functions from another process? If, how to communicate with the mainapp and vice versa?
Any ideas/help appreciated.
Nikolaus
|
|
|
|
|
You could look at using COM as your API mechanism; you can create inproc servers, and use them inproc for debugging and out of proc to air-gap your app from the faults
However, I'd suggest it would be far more effective fixing your broken code, than trying to implement a cute way to hide the problem
|
|
|
|
|
I am talking about external plugins. "third party modules" - if the problem/crash arises there, it can crash, but it should not affect the calling application.
|
|
|
|
|
Then you do have a problem
Presumably there's a documented API between your app and the plugins?
Could you create a shim, using templates or similar, that protects all plug-in calls with exception handlers?
COM is still an option
|
|
|
|
|
In general wanting the host application to survive an in-process plug-in crash is misguided. It can leave the application in an unstable state and cause problems at a later time which can seem unrelated to the original problem and are much harder to fix. The classic example is a corrupt heap which often manifests in a crash in the allocation or de-allocation of memory some time after the actual real problem.
Steve
|
|
|
|
|
Hi All,
Recently I heard about .NET profiling API and want to implement it. To do that, I require to build an ATL based COM project. Unfortunately I am using Visual C++ express edition which doesn't supports ATL. So I googled for a free alternative to ATL. I got COMET[^] and DispHelper[^]
Can I use these libraries to implement .NET profiling API? Thanks for your kind advice.
Regards,
Thomas
|
|
|
|
|
COMET looks best
good luck
|
|
|
|
|
What do you think is the best control for getting keyboard and mouse input? I need to be able to over ride OnKeyDown, OnChar, OnMouseMove, OnLButtonDown & Up. I need to be able to control every aspect of how to respond to the input.
CRect Pos(50,200,200,220);
CWnd MyWnd;
MyWnd.Create(_T("WHAT HERE???","MyInputWnd",WS_CHILD|WS_VISIBLE,Pos,this,1);
Thanks in advance.
|
|
|
|
|
What do you mean by 'best'? The issue is rather what is the purpose of your Window; keyboard and mouse input is always available.
The best things in life are not things.
|
|
|
|
|
Dear all,
I have the task to wrap a list<myobject> inside a .NET wrapper, and actually after some heavy researching and editing, it seems to work, but I dont trust that I have understood all unmanaged issues correctly.
First, I found I should add an operator overload and a copy constructor to my class:
RawCoil::RawCoil(const Core::RawCoil& pParam)
{
*this = pParam;
}
RawCoil& RawCoil::operator=(const RawCoil &obj)
{
this->Id = obj.Id;
return *this;
}
Is this correct?
Then, there is the main list variable, which is used inside the unmanaged code. When is the memory allocated/freed, this I don´t understand:
list<RawCoil> coils;
Another interesting questions. The List<> from .NET will arrive with new elements from time to time, and I have to synchronize it to the unamanged code:
int unmanageCoils(List<Coil^>^ managedCoils, list<Core::RawCoil> *unmanagedCoils)
{
unmanagedCoils->clear();
for(int i=0;i<managedCoils->Count;i++)
{
Coil^ coil = managedCoils[i];
Core::RawCoil newCoil;
newCoil.Id = ManagedToSTL(coil->coilId);
unmanagedCoils->push_back(newCoil);
}
return managedCoils->Count;
how is the memory allocation treated for the list elements?
The thing is I want to prevent any leaking of memory, as I am normally only developing in C# and quite paranoid when I have to switch back to old times
kind regards Florian
|
|
|
|
|
I make the program to show the leaves in BST, but how to show only nodes that have leaves as children?
int OnlyLeafNodes(Elem *t)
{
if(NULL == t) return 0;
if(NULL == t->left && NULL == t->right) cout << t->key << endl;
else return OnlyLeafNodes(t->left) + OnlyLeafNodes(t->right);
}
Here is the INPUT and OUTPUT that I use for test. It has to show 4, instead of 2 and 5. Because 4 is the node that has only leaves.
http://img40.imageshack.us/img40/1421/treex.jpg
|
|
|
|