|
HI David,
Thanks For your Kind Response.. i Finally found a solution to it.. i.e i posted WM_IDLEUPDATECMDUI on the main thread.. and it helped me.. i also used
LRESULT CMyDialog::OnIdleUpdateCmdUI(WPARAM wParam, LPARAM lParam)
{
if (IsWindowVisible())
{
SendMessageToDescendants(WM_IDLEUPDATECMDUI, wParam, lParam);
}
return 0L;
}
as i had many toolbars..
Thanks Again
Samir Satardekar
|
|
|
|
|
Hi,
Recently we have a new hardware that came with USB interface and is written as COM object library with a .tlb and .lib file along with .h(which has only #define constants) file. I create an MFC project with ATL support and using this library it was easy to program in VC++ by including .h file and importing .tlb file and declaring a CComPtr and at last using CoCreateInstance to create a instace of the comptr. But this is all not possible in CVI. Is there any way to create a DLL with ATL support that can be used in CVI (which is basically a C compiler). I tried creating a ATL DLL and using it in CVI and it came up with a lot of errors in WINNT.H or is there any other way to interface with this hardware??
thanks,
-PNT
PKNT
|
|
|
|
|
CVI = Labview CVI, yes ?
I did some looking at the manual and it wasnt obvious - a search through google revealed this book "Advanced Topics in LabWindows/CVI"
by Shahid F. Khalid which was illustrating how to use the 'DataSocket' object - which is an ActiveX control so that seemed 'hopeful'
Other than that CVI seems to like 'simple c-style Dlls' but Ive only had a very quick look, so dont be discouraged .. thought - can you create a 'proxy' dll that exposes simple methods to Labview/CVI yet interfaces to your USB COM interface on 'the other end'
'g'
|
|
|
|
|
I m trying to change the bitmap of an exe externally without making any changes in resource file(.rc) of that application.now i m able to retrieve the bitmap file data as well as exe bitmap data, but unable to change exe bitmap.it errazing original bitmap of an exe, when i m calling UpdateResource function of MFC.
|
|
|
|
|
Are you looking for a temporary change? Something does by SetIcon API? Are you trying to call UpdateResource from an external application?
If doesn't have the source code of that application or not planning to update any source of that application, Probably you may need to Inject some DLLs to application which can load and update the icon at runtime. Update resource function will make permanent change in your exe.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
i dont want to change icon of an EXE, i want to change Bitmaps for an EXE externally, without making any changes in the application of that EXE.
|
|
|
|
|
Look into API call hooking and DLL injecting as Sarath also suggested. Try hooking the LoadBitmap or LoadImage calls and for the bitmap IDs you want to change load different bitmaps and return those. Good luck.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Although it's a pretty easy task once accustomed to the type of work, you may find the solution a little offputting.
All you have to do is add a bitmap to the exe file using a EXE-file resource editor, then modify the code that loads the original bitmp so that it now loads the new bitmap (with it's new resource ID)
The first task you can do with Reshacker, the second you'll need OllyDbg or any other dissassembler/hex-editor combo. Generally speaking, each time your program loads the bitmap resource, it makes a call to LoadResource. One of the arguments for this call is the resource ID of the resource to load.
You need to find all instances of this old resource-ID and change them to the resource-ID of the new bitmap. (You can directly edit the dissasembly, and save changes back to an exe file)
|
|
|
|
|
I have C++ source code as following:
CString rcvBuff;
LPTSTR lpBuff;
lpBuff = rcvBuff.GetBuffer(300);
I want convert to standard C language. Please help me.
Thank you verry much!!!!
thank you for helping
|
|
|
|
|
Hi,
is (char*)malloc(301); what you are looking for?
if so, don't forget to call free() eventually.
|
|
|
|
|
Hi Luc Pattyn, thank you for your help.
But I still haven't know yet.
Do you mean:
rcvBuff = (char*)malloc(301);
Then... the relation of 'lpBuff' with 'rcvBuff'?
Please help me!
thank you for helping
|
|
|
|
|
Hi,
in C a string is just a pointer pointing to a number of bytes containing (or intended to contain)
a sequence of characters ending on a NULL; so either you already have a string, and hence you have
the pointer, or you need to create one, and then you call malloc.
|
|
|
|
|
hi Luc Pattyn,
Thank you for yor help.
I have a question.
rcvBuff = (char*)malloc(301);
Then
free(rcvBuff);
is this right? I think that 100 and 300 are related.
please help me!
thank you for helping
|
|
|
|
|
Hi,
I don't know what your 100 would stand for.
to undo a malloc you call free() without arguments; you can only free the entire buffer, which should be OK.
There are more specialized functions but I have never needed them at all.
You know there is such a thing as documentation that tells you all the details you may ever need...
|
|
|
|
|
Hi Luc Pattyn,
Anyway, thank your for your help .
thank you for helping
|
|
|
|
|
Hello,
Is there any reason why dynamic_cast<> is turned off in my MFC projects by default?
I always get (in Debug and Release builds).
warning C4541: 'dynamic_cast' für polymorphen Typ 'CWnd' mit /GR- verwendet; unvorhersehbares Verhalten möglich
Is there any reason to not add the /GR switch?
Why is this not done by default?
The whole C-style casting with objects in the MFC code itself is really bad coding style anyway (C-style casts should not be used any more in C++)
Regards,
Niki
|
|
|
|
|
What about documentation [^]?
It looks like you're using Visual Studio 2003 or earlier.
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]
|
|
|
|
|
Heh. I was wondering how old the Visual Studio version had to be.
I can't remember the last time RTTI wasn't enabled by default.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
According to documentation [^] Visual Studio 2003 is old enough.
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]
|
|
|
|
|
According to my age, my memory doesn't go back that far
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
According to the photograph in your CodeProject member's page, you're not that old.
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]
|
|
|
|
|
That was taken when I was 40.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
For determining class relations at runtime, MFC have its own mechanism called RTCI(Runtime Class Information) which is similar to RTTI in C++. You can resolve class relations by using CRuntimeClass::IsKindOf() etc.
[Edit] With respect to Pillani's reply.
So its obvious that C++ RTTI will be switch offed by default, since MFC itself is providing support. Enabling two similar stuffs at same time helps only to reduce performance.
I'm not sure, but i think that the RTCI evolved and exists together with RTTI due to historic reasons.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
modified on Monday, January 5, 2009 5:12 PM
|
|
|
|
|
Thank you very much, I've enabled it now and use dynamic_cast.
Yes, I habe VS 2003 .NET.
Niki
|
|
|
|
|
Hi,
I'm a long-time C++ programmer and relatively new in C#.
I have not been working with UI-related stuffs for a while.
Recently I had a project that is related to a GUI-based application, which requires a custom-style listview control. I found some listview controls in "the code project" that may fit to my purpose. But most of them are written in C# and it's output is a Class Library (DLL). In general, is there any way for me to use those custom listview controls written in C# in my Win32 C++ project (using Visual Studio 2005)? Or is it simply impossible? Thanks a lot for your help in advance.
|
|
|
|