|
|
Hello,
Thanks for your reply
I have the following code
CMenu M;
M.CreateMenu
M.AppendMenu(MF_STRING, id_DAta, "Data");
M.AppendMenu(MF_STRING, id_Edit, "Edit");
M.AppendMenu(MF_STRING, id_Model, "Model");
Now the above code works.
How should I have popup menu like the following attached to Data. I do not want to add to the 3 menu options above
CMenu M1;
M1.CreatePopupMenu
M1.AppendMenu(MF_STRING, id_Data1, "Data1");
M1.AppendMenu(MF_STRING, id_Data2, "Data2");
M1.AppendMenu(MF_STRING, id_Data3, "Data3");
Thanks
Prithaa
|
|
|
|
|
|
|
Hello,
Before posing the question to the codeproject forum I went through the MSDN CMenu examples but I did not understand how to attach a popup menu to an existing menu which is already there with MF_STRING parameter .
I think somewhere I should use ModifyMenu() to make changes in the Menu but I don't know how to use ModifyMenu
So please help me.
Thanks for your concern
Prithaa
|
|
|
|
|
I read your previous message and your reply to yourself it seems that your problem solved.
|
|
|
|
|
Hello,
Ya, Actually I was just trying to mail in different forms to make my question understandable and understood myself.
Thanks WhiteSky
Prithaa
|
|
|
|
|
Well if we want to get a result of your message that is you are a clever programmer.;)
|
|
|
|
|
I have a class derived from CWinThread, which have a CWnd* member which would recieve message from the thread. In the class also has a socket member,it would send network message to the CWnd* member.
I use such class in a Dialog,it works well.But when the main dialog create a new child dialog and show it using DoModal() function, and I want to make the child dialog correspond to the thread message and network message. In the child dialog,I send data to somewhere,but the class does send the data when the child dialog closed. Why?
Thanks
Good Luck.
|
|
|
|
|
Why?
Perheps, because the child dialog is modal.
In the child dialog,I send data to somewhere,
Please, specify more details. What do you actualy do? How do you send?
--
=====
Arman
|
|
|
|
|
I feel like a bit of a newbie asking this, but I have never had to access elements on the main form from outside it before.
So here it is: I need to access a textbox from a cpp file .... the textbox is on the main form which is initialized in the main function ... with the usual Application::Run.
in the main cpp file:
..........................................
#include "Form1.h"
int main(array<system::string ^=""> ^args)
{
Application::Run(gcnew Form1());
Form1::textBox1->Text = "some text";
}
...........................................
This doesn't work of course, because I am referencing the header class itself, and not the form instance .... but what is the form instance ????
now ... I know I could use ...
Form1^ myForm = gcnew Form1;
myForm->ShowDialog();
except that gcnew objects cannot be declared globally, and I need to access some of the form elements from other parts of the code, not main().
So I'm stuck .... any help would be appreciated.
Thanks
Aaron
|
|
|
|
|
aaron_leese wrote: any help would be appreciated.
Try here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Your code is 100% Managed and you must ask on the correct forum.
|
|
|
|
|
I get the following linker error:
error LNK2019: unresolved external symbol "__declspec(dllimport) public: ...
...with this code:
typedef int (MainWindow::*MainWindowPtr)(void);
CallbackWrapperSpecific<MainWindow, MainWindowPtr, int>* cbPtr = new CallbackWrapperSpecific<MainWindow, MainWindowPtr, int>(this, &MainWindow::DoWork);
I'm implementing an extended version of a functor (Link), and for some reason, I still get the linker error even though I'm exporting my symbols in the following header file:
#ifndef CALLBACKWRAPPER_H
#define CALLBACKWRAPPER_H
#ifdef _EXPORT
#define THREADAPI __declspec(dllexport)
#else
#define THREADAPI __declspec(dllimport)
#endif
template <class Type>
class THREADAPI CallbackWrapperBase
{
public:
virtual Type Execute() = 0;
};
template <class ClassPtr, class Callback, class Type>
class THREADAPI CallbackWrapperSpecific : public CallbackWrapperBase<Type>
{
public:
CallbackWrapperSpecific(ClassPtr* pClass, Callback pCallback);
Type Execute();
ClassPtr* m_classPtr;
Callback m_callbackPtr;
};
#endif
Anyone know why this still happens?
-- modified at 16:45 Monday 11th June, 2007
|
|
|
|
|
Just check to see that you have not defined the THREADAPI in your calling module too.
|
|
|
|
|
In my calling project, in Visual Studio project options, I have not included _EXPORT as part of the preprocessor defines, but in every other project, I have.
|
|
|
|
|
|
Hmm... that's probably something I should've known but have never heard of. I learn something new everyday!
Thanks.
|
|
|
|
|
I am trying to do a GetModuleHandle of another dll from my own dll and do a FreeLibrary. But its not working.
Why?
How can I make termination of another dll from my own dll work.
Rajdeep
|
|
|
|
|
rajandpayal wrote: But its not working.
What's not working, GetModuleHandle() or FreeLibrary() ? Keep in mind that calling FreeLibrary() does not affect other processes using the same DLL.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
GetModuleHandle works. FreeLibrary is not taking the dll away. The concerned dll remains loaded.
As fyi the dll from where I am calling GetModuleHandle and then FreeLibrary is NOT the one which
loaded the dll to begin with.
But this should work. Isnt it??
|
|
|
|
|
rajandpayal wrote: But this should work.
No, it shouldn't. Why would you think otherwise?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
OK. Fine. Excuse me for being ignorant.
I want to understand this a bit more.
What is making this not to work?
|
|
|
|
|
rajandpayal wrote: What is making this not to work?
It's not designed to work that way. You're doing nothing wrong. See here for more on reference counts, address spaces, etc.
Perhaps if you explained what you're ultimately after, someone could offer an alternative solution.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
We are seeing some memory leaks in our apps which are getting difficult to track down
even with using various tools like purify, boundschecker. mem validator etc..
I was actually trying to see if just by releasing a particular (from another dll in that process) dll, it helps..
But I realize that it wont help much since memory leaks usually result from we not freeing up heap allocations... And heap is process wide..
|
|
|
|