|
If your submenus are for display purposes only (i.e. the app won't do anything when they're selected), then there's no need to write any command handler. Apart from this, check your docs for ON_COMMAND , they should be self-explanatory.
(I'm away from my VS now, can't help more.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Here is the problem. I need to use a dll compiled with VC6. This dll exposes a function which arguments are of type std::wstring. My main app needs to be compiled with VC.NET. However, std::wstring in VC.NET is not the same as std::wstring in VC6, and I have a nice little crash every time I try to call this function. I thought that I could solve this problem by linking to VC6 libraries from VC.NET.
The question is: How to set VC.NET project to link to msvcp60d.dll and msvcrt.dll instead of msvcp70d.dll and msvcr70d.dll?
|
|
|
|
|
Set the UseOfMfc project property to None, and add the appropriate libraries in the link tab.
If you are not using the VC7 libraries (stl7, mfc7, atl7, ...), then I don't know why you use VC7 at all. If you own the source code of this dll, then it's way much better to upgrade this dll to be full compliant with VC7.
|
|
|
|
|
I tried it already, and it doesn't work.
.S.Rod. wrote:
If you are not using the VC7 libraries (stl7, mfc7, atl7, ...), then I don't know why you use VC7 at all. If you own the source code of this dll, then it's way much better to upgrade this dll to be full compliant with VC7
Trust me: I need to use VC.NET with a VC6 compiled library
|
|
|
|
|
Nemanja Trifunovic wrote:
Trust me
No.
Nemanja Trifunovic wrote:
I need to use VC.NET with a VC6 compiled library
Write a bootstrap then. That's a dll compiled with VC6, which exposes a simple set of functions, with no stl signature at all. Doing so, the underlying dll is not facing stl7 in VC7.
|
|
|
|
|
.S.Rod. wrote:
Nemanja Trifunovic wrote:
Trust me
No.
LOL.
.S.Rod. wrote:
Write a bootstrap then
That's a good idea, thanks. If I don't find out how to use VC6 libs, I might do just that.
|
|
|
|
|
In my debug version, it does fine. rElease crashes on exit. Its an MFC MDI app, which spawns CDialog derived windows. These get pushed on to a vector and popped off when they are closed (they postmessage to the CView that spwaned them.). ANyways all I do is spawn one (modeless ) window, and close it. Then exit and it crashes, but only in the release version. I dont know where to start looking for the trouble. I dont rknow if the foll. helps.....
void CImageDisplay::OnClose(void)
{
std::vector<CImageDisplay*>::iterator itV = pImageDisplayVector.begin();
for (int i = 0 ; i < m_imageDisplayVectorIndex ; ++i , ++itV);
pImageDisplayVector.erase(itV);
imageDeque.pop_back();
m_pParentWnd->PostMessage(UDM_UPDATEDISPLAY);
CDialog::OnClose();
}
Its not the pop_back because it still crashes if I comment it out.
In the function that creates the window:
CImageDisplay* pImageDisplay = new CImageDisplay();
if (pImageDisplay == NULL) return;
BOOL ret = pImageDisplay->Create(IDD_DIALOG1, this);
if(!ret)
{
AfxMessageBox("Error creating Dialog");
delete pImageDisplay;
return;
}
pImageDisplay->ShowWindow(SW_SHOW);
pImageDisplayVector.push_back(pImageDisplay);
imageDeque.push_back(image);
m_imageIndexHi = m_imageIndexLo + imageDeque.size() - 1;
UpdateDisplay();
image.SetRawImagePointer(0);
Appreciate your help,
ns
|
|
|
|
|
I dont have an OnDEstroy or anything in the mainframe so dont know how to debug it...
Appreciate your help,
ns
|
|
|
|
|
In my MFC MDI app, I switch views. The views merely switch, they dont get recreated, so OnInitialUpdate doesnt run each time y ou switch. In View1 I have a top level menu item "User Choices" . INitially when clicked, it says nothing selected. I now go to view 2. I get information from the user in View 2, then I switch. By the time I get back to View 1, I want View 1 to have the menu ITem "User Choices" to be populated. So now when the user clicks it, a submenu drops down. Each submenu item then has its own flyout menu. WHen the user goes back to View 2 and makes new choices and returns, the menu should now have the new stuff in it.
SO should I send a message which runs a function in View 1 which then magically creates the menu using the info I gathered in View 2 and stored in a doc variable?
How do I destroy the old menu choices , so that the new ones get filled in on return to view1? In case the user cancels from View2, View 1 should retain the previous choices.
Appreciate your help,
ns
|
|
|
|
|
Anyone who knows if the file oledblob.h is avalible for the Visual Studio .NET enviroment?
(oledblob.h is an OLE DB consumer class dealing with updating and inserting blob data)
|
|
|
|
|
Is there away for an executable to modify itself, for example append data at the end of the executable or modify some internal data.
Thanks
|
|
|
|
|
If you can get to modify the flags for file opening (I mean getting rid of the flag "file in use so i cannot modify it"), you may do something like that. But it's hot stuff. What do you want to do ? A virus or something ? Anyway, there have to be a better solution to your problem than directly modifying the .exe
~RaGE();
|
|
|
|
|
Please could someone provide me with a working sample of using UpdateResource on the string table of an external exe app. Ive read several articles from MSDN in regards to string table blocks containing 16 strings etc, and allocation of the string, however no matter what i try i always seem to either overwrite the entire string block table or create an entirely new one.
My goal is to update a single string item within the string table with the contents of a user entered string.
Any help would be much appreciated.
Thanks
zebbedi
|
|
|
|
|
Hello,
I have the following code to pull HTML data from a website.. Everything works fine except that I have a small memory leak.. can someone tell me why there is a memory leak in CStdioFile..
here is the dump of the memory leak
Detected memory leaks!
Dumping objects ->
{44} client block at 0x00D226A0, subtype 0, 20 bytes long.
a CStdioFile object at $00D226A0, 20 bytes long
Object dump complete.
LPSTR url = "http://www.codeproject.com";
LPSTR filename = "C:\\codeproject.txt";
int numbytes;
char httpbuff[2048];
CInternetSession mysession;
CFile* myfile = new CFile();
CStdioFile* remotefile = new CStdioFile();
remotefile = mysession.OpenURL(url,
1,
INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_RELOAD);
myfile->Open(filename,
CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
while (numbytes = remotefile->Read(httpbuff, 2048))
myfile->Write(httpbuff, numbytes);
myfile->Close();
remotefile->Close();
delete myfile;
delete remotefile;
Rob
|
|
|
|
|
you don't need this
RobJones wrote:
CStdioFile* remotefile = new CStdioFile();
because
RobJones wrote:
mysession.OpenURL(url, 1, INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_RELOAD);
returns a CStdioFile pointer
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
If I do a ...
CStdioFile* remotefile = mysession.OpenURL(url, 1, INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_RELOAD);
I still have a memory leak...
|
|
|
|
|
you still need to delete the remotefile pointer
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Ahhhhhh.. Ok thanks.. that fixed it
Thanks,
Rob
|
|
|
|
|
I'm looking for some code examples for using SCP to transfer files. I'm going to throw together a dialog for browsing remote directories using SCP [basic version of WinSCP[^]] if a MFC one doesn't already exist out there as I'll need this feature in a project I'll do in the near future.
I was just wondering if anybody knows of something similar or if it's been implemented elsewhere. I can't seem to find anything but I'm probably just being blind and it's probably right under my nose.
Regards,
Brian Dela
Run naked in the snow until you're sweating like a stuck pig and can't seem to catch your breath. When the flu becomes pneumonia, they can cure that with a shot. - Roger Wright
|
|
|
|
|
You can't really browse anything with scp AFAIK. You can only do transfers.
But here's a link to PuTTY which is a set of ssh-tools for windows. Sources are available. http://www.chiark.greenend.org.uk/~sgtatham/putty/[^]
--
Eventhough the forrest is full of trees, there's still no tree between the trees.
|
|
|
|
|
Jörgen Sigvardsson wrote:
You can't really browse anything with scp AFAIK. You can only do transfers.
But here's a link to PuTTY which is a set of ssh-tools for windows. Sources are available.
Yep... I was going to use the putty code to help with browsing etc. Have it for a while now.. Just need to get some time to have a look at it.
Thanks Jörgen
Regards,
Brian Dela
Run naked in the snow until you're sweating like a stuck pig and can't seem to catch your breath. When the flu becomes pneumonia, they can cure that with a shot. - Roger Wright
|
|
|
|
|
Hi All,
I have an app that uses splitter windows. How can I get the size of a pane in the splitter? Can I just use CsplitterClass->GetRect(&rect) ??
Problem is how do I get the handle for the that pane. any suggestions?
Thank you.
Dan Willis
|
|
|
|
|
Never mind. It was a simple solution once I thought about it for a moment. LOL. Thanks anyways.
Dan Willis
|
|
|
|
|
Hi all,
does anyone know a tool to create a Class-Graph out of the Source-Code of a VC++ 6 project? I need to show up all the references to a class.
It also would help a lot if it lists all references in a textfile. Then I can draw the Class-Graph myself.
Thanks.
--
karl
|
|
|
|
|
have a look at Doxygen, it does not offer a graphical graph, but it shows you this;
maybe with the DOT (GraphViz extension) it can do it. I was about to try it this week.
Max.
|
|
|
|