|
I am not sure of the setting but I would say that I have installed .net 2003 just to debug my vc6 applications with the .net debugger. As is a lot better than the one with vc6 especially if you want to do remote debugging. One way to use the .net debugger is to load your project with it .net and let it upgrade to .net then exit. It will create a .sln and .vcproj for .net to load, don't worry it will not trash your .dsp or .dsw files so you still can compile and develop with vc6. I do this all the time.
John
|
|
|
|
|
I'm in case that function returned for me JPEG file data in CString.
so I write the CString data to IStream Object and then save the file but I'm
getting InvalidParameter , i do not know why? here is code snippet
Write(CString image, int len)
{
CLSID encoderClsid;
GetEncoderClsid(L"image/jpeg", &encoderClsid);
LPBYTE lpBits = (LPBYTE) GlobalAlloc(GMEM_MOVEABLE, len);
IStream *pStream;
HRESULT res = ::CreateStreamOnHGlobal(lpBits,FALSE,&pStream);
LPTSTR sImage = image.GetBuffer(len);
pStream->Write(sImage,sizeof(sImage),NULL);
LARGE_INTEGER li;
li.QuadPart = 0;
res = pStream->Seek(li,STREAM_SEEK_SET,NULL);
if(SUCCEEDED(res))
{
Image *jpgImage = Image::FromStream(pStream);
jpgImage->Save(L"C:\\myImage.jpg",&encoderClsid,NULL);
//here Save return InvalidParameter , WHY? any suggestions?
}
}
|
|
|
|
|
All items are grayed out, why?
void CMyFrameWnd::OnRButtonUp(UINT nFlags, CPoint p)
{
CMenu menu;
menu.CreatePopupMenu();
menu.AppendMenu( MF_STRING | MF_ENABLED , 700 , "Zoom All" );
menu.AppendMenu( MF_STRING | MF_ENABLED , 701 , "Properties" );
ClientToScreen(&p);
menu.TrackPopupMenu(TPM_CENTERALIGN,p.x,p.y,this,NULL);
CFrameWnd::OnRButtonUp(nFlags, point);
}
|
|
|
|
|
Do you have a handler function for menu items 700 and 701?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
No I am overriding OnCommand()
For CWnd's this seems to be enough - maybe for CFrameWnd's it's not enough?
|
|
|
|
|
MFC's framework will disable menu items for which a handler has not been provided. There is no way for it to know that you are handling menu item requests from within OnCommand() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
So I shouldn't override OnCommand(), instead I should create a handler?
ON_COMMAND_RANGE( 700 , 701 , OnMenuCommand )
afx_msg void OnMenuCommand ( UINT nID )
I just wonder - why is OnCommand() virtual then?
|
|
|
|
|
You can add onupdatecmdui handlers for each id and then use oncmommand, I do this a lot.
John
|
|
|
|
|
Jesper Knudsen wrote: So I shouldn't override OnCommand(), instead I should create a handler?
That's how I would proceed.
Jesper Knudsen wrote: I just wonder - why is OnCommand() virtual then?
It has its purpose. My most recent use of it was on a property sheet. I needed to handle the clicking of the OK button.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thank you for your help, it works with the handler - still I wonder, still I wonder..
|
|
|
|
|
|
I'm using a class derived from CHtmlView as listview in an internal Folder
Browser of my application.
Exist a facility to hide the left blue task pane (if user have activate this
feature in Folder Options)?
Another fine feature will be, to set the "list" as active default view in my
application (may be the user has set "icon" as default). Any idea?
Thx for help
|
|
|
|
|
Check out this article[^]
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
I dont want integrate html in my view and i dont want use a own written class derived from CView. I use the CHtmlView. This is the starting point. And i use this class for File browsing (Navigate2(pidl)).
Thx, for you comment, but this artikel was not what im locking for (or did i have some overlooked??)
|
|
|
|
|
Hi,
I've created a dll (C++) containing several functions, which are used inside an Excel-VBA-Project via dll-calls.
What I want: when the dll is loaded into memory (i.e. when one of the functions is executed first time), a general function should be executed (purpose: check licence information etc.).
Is there an event, which is triggered when the dll is loaded ?
TIA M.
|
|
|
|
|
BOOL WINAPI DllMain(
HINSTANCE hinstDLL,
DWORD fdwReason,
LPVOID lpvReserved
);
fdwReason -> DLL_PROCESS_ATTACH -> The DLL is being loaded into the virtual address space of the current process as a result of the process starting up or as a result of a call to LoadLibrary. DLLs can use this opportunity to initialize any instance data or to use the TlsAlloc function to allocate a thread local storage (TLS) index.
|
|
|
|
|
I would like to know how to pass CStatic as normal variable to member function?
When I try to do it, I will get a message
"cannot convert parameter 1 from 'class CStatic' to 'class CStatic'"!
Please help!
|
|
|
|
|
Post the code.
Why do you want to pass a CStatic variable to a member function ??
|
|
|
|
|
I have some repeatly process which will use serveral CStatic variable.
How can I make a member function to do it?
Please help!
|
|
|
|
|
Either use a pointer or a reference.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
You beat me. :P
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
(Off the top of my head guess)
CStatic might not have a copy constructor.
Try declaring the function as
void FuncX (CStatic &MyStatic);
- or -
void FuncX (const CStatic &MyStatic);
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
It's working now!
Thank you very much!
|
|
|
|
|
hi can anyone tell me
how can i get & send data to
a USB port from a VC++ application
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
You do not send data to the USB port, you send data to the device attached to the USB port.
The tigress is here
|
|
|
|