|
It depends on how complicated you wanted to get with the method that you want to display the result.
Inside the function in the C++ DLL, you could simply call MessageBox and display the result. Or you could get more complicated and create a dialog or a window and display more complicated feedback data.
If this is the case though, why not just do it with Visual Basic.
Although I do have one more thought, are you trying to display the output in a console window like a regular console app displays the data?
If you help me understand why you are doing this, or possibly more details in what and how you want to display the data, I may be able to help you out more.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
thanks a lot....
the reason i wnat to display in vc is because it's a homework~~~~~~
and i must to do that :
in VB:
public sub form_mousedown(....)
'send a message to VC and show in VC ,
'the message is like "wellcome to VB and VC"
end sub
and the message i can run in vc file...
just show the message "wellcome to VB and VC"
please help me to write this code or
you can write a simple fot me.....
because i have never learned VC.....
so~~~~~~
thanks.....
|
|
|
|
|
thanks for a lot....
the reason i wnat to show the para in VC is just it's
a homework, and i tyr many times it dosen't work.
so i need your help.
the question is that
in VB:
public sub form_mousedown(...)
'sent a message to VC
'and display in VC file,
'the message just like "Hi,Wellcome to VB and VC"
end sub
and i don't konw how to write those code in VC
because i have never learned VC,so i really need to your help...
can you write a simple code to me,let me see the file in VC
and write a dll file make the qeustion can work ...
i really need your help....thanks~~~~~~~~`Good luck
|
|
|
|
|
I have an MFC child dialog that I use on an windows CE machine. I would like to place that dialog into another MFC dialog which is skinned when the app is compiled for a non-ce device, ie. the desktop computer. All I need to know is - what is the way one would embed a dialog in another dialog. I have seen how to embed a child dialog into a form view and was also wondering how this compares to doing dialog within dialog. What would be easiest taking in account that I have a skin on the parent dialog.
Cheers,
Clint
|
|
|
|
|
Embedding a dialog into a CFormView or another CDialog is basically the same: have the child dialog have no border, and on the OnInitDialog of the parent dialog create the child with suitable parent and position it. There are additional details to fill in, but the basics are simple.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for your help. A little trial and error finally got me what I was looking for
|
|
|
|
|
Hi,
I want my program to search if a program is installed or not , from the registry(???).How can i do that(i use MFC)??
|
|
|
|
|
One solution is to check the registry key in the uninstall section. If the registry key is not found, the MFC function should return NULL. Better yet, use a Win32 API registry function including RegOpenKey().
LONG RegOpenKey(HKEY hKey, LPCTSTR lpSubKey, PHKEY phkResult);
Kuphryn
|
|
|
|
|
Could you tell me how can i check the registry key in the uninstall section?If you have an example send it to me.
Sory And Thanks!
|
|
|
|
|
Maybe I'm just not good at finding things on MSDN, and my help doesn't list anything in the index about NM_TREEVIEW Anyway, how do I get information from a CTreeCtrl when I handle the CLickTree?
I have:
void CMyDlg::OnClickTree(NMHDR* pNMHDR, LRESULT* pResult)
{
int iRoot = iTheRootOfItemClicked;
int iSub = iSubIndexOfItem;
int iItem = iTheIndexOfTheItem;
}
How do I get that info or am I supposed to do this some other way???
There's honorable mentions of TV_ITEM things and
HTREEITEM, but all I get is:
HTREEITEM Handle to an item in a tree-view control.
Somehow that doesn't help me much.
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Try searching on NMTREEVIEW -- this is what I found:
typedef struct tagNMTREEVIEW {
NMHDR hdr;
UINT action;
TVITEM itemOld;
TVITEM itemNew;
POINT ptDrag;
} NMTREEVIEW, FAR *LPNMTREEVIEW;
That's the structure -- you should be able to cast the pNMHDR to a NMTREEVIEW pointer, and then get the struct member of NMTREEVIEW that you want...
Once you get the tvitem you want, use the tvitem.hItem (which is an HTREEITEM) and then use the CTreeCtrl member functions to get the properties of the item you need...
"If at any time I announce that a nation or kingdom is to be uprooted, torn down and destroyed, and if that nation I warned repents of its evil, then I will relent and not inflict on it the disaster I had planned. And if at another time I announce that a nation or kingdom is to be built up and planted, and if it does evil in my sight and does not obey me, then I will reconsider the good I had intended to do for it." -- Jeremiah 18:7-10 (God, commenting on the value of the United Nations)
|
|
|
|
|
Chris Hambleton wrote:
Once you get the tvitem you want, use the tvitem.hItem (which is an HTREEITEM) and then use the CTreeCtrl member functions to get the properties of the item you need...
um, I think this is what I don't know how to do
Say I have a tree:
- Root1
|
|-- SubRoot1
| |
| |- Item1
| |- Item2 <-- And I click on this one...
| |- Item3
|
|-- SubRoot2
|
|- Item1
|- Item2
How would I be able to say:
You Clicked 1.1.2
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
NMTREEVIEW* pNMTV = (NMTREEVIEW*)pNMHDR;
HTREEITEM hItemNew = pNMTV->itemNew.hItem;
HTREEITEM hItemsParent = m_wndTree.GetParentItem(hItemNew);
HTREEITEM hItemsParentsParent = m_wndTree.GetParentItem(hItemsParent);
Shog9
------
And on the pedestal, these words appear:
"My name is Ozymandias, King of Kings,
Look on my Works, ye Mighty, and despair!"
Nothing beside remains.
|
|
|
|
|
Of these STL containers, which ones will naturally sort their contents as you push them on?
Vector, List, Set, Map
Thanks
Appreciate your help,
ns
|
|
|
|
|
set
-c
Support regime change. Vote.
|
|
|
|
|
set and map (the ordering in the latter is done by the key).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for letting me know its sorted on the key.I was wondering....
Appreciate your help,
ns
|
|
|
|
|
Hi gurus,
Suppose you have some classes like these:
class BaseClass<br />
{<br />
public: virtual long getValue() {return 0;}<br />
};<br />
<br />
class SubClass1 : public BaseClass<br />
{<br />
public: virtual long getValue() {return 1;}<br />
};<br />
<br />
class SubClass2 : public BaseClass<br />
{<br />
};<br />
<br />
void SomeFun (BaseClass *someInstance)<br />
{<br />
}<br />
<br />
int main (int argc, char **argv)<br />
{<br />
BaseClass baseInstance;<br />
SubClass1 subInstance1;<br />
SubClass2 subInstance2;<br />
<br />
SomeFun (&baseInstance);<br />
SomeFun (&subInstance1);<br />
SomeFun (&subInstance2);<br />
}
In other words, in SomeFun I want to find out which implementation of getValue is used by the given instance. I don't want to actually call someInstance->getValue, but I just want to find out which method would be called if I would call it.
I tried to find the address of the method by using
&someInstance->getValue
and
someInstance->getValue
but the first one doesn't compile, and the second one gives a warning and doesn't work.
Notice I don't want to use something like
pMethod = BaseClass::getValue;
or
pMethod = SubClass1::getValue;
since I don't know who has inherited from my BaseClass, nor which instance is given as argument to me. I just want to know: the class of which an instance is given to me, has it overruled the virtual method getValue or not?
Of course a solution could be to add another virtual method, something like:
bool iHaveOverruledGetValue();
which should be implemented by each subclass (if they have overruled the getValue method, but that doesn't seem like a good solution either.
Anyone suggestions ?
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
Patje wrote:
Of course a solution could be to add another virtual method
IMHO, that seems like the best approach, both from an OO standpoint and a maintainability one. otherwise, with the pointer idea, you're writing code that is at best confusing and at worst non-portable.
-c
Support regime change. Vote.
|
|
|
|
|
You can create a switch statement and try dynamic_cast but that requries RTTI to be enabled.
I would just add a virtual method.
Todd Smith
|
|
|
|
|
is there a way to stop this from open when a certain condition is met?
I'm trying to do this in the OnDropdown section of code and anything I do dosen't stop the dropdown from opening.
Thanks for your help,
Jim
|
|
|
|
|
I assume it's for a combox box, why can't you just disable the control ?
the OnDropDown is the callback.
Max.
|
|
|
|
|
Here is what the code looks like. I couldn't find anything that would just quite without displaying that drop down.
void CAMID::OnDropdownMSel()
{
CComboBox *pMSelBox = (CComboBox *) GetDlgItem(IDC_MISSION_SEL);
if(HostStruct.bFreeze == false)
{//warn user...and quit dropdown
MessageBox("blah blah blah", "Warning!", MB_OK);
}
else
{
//drop down box
}
|
|
|
|
|
I have strings (numeric) of various lengths:
"123"
"2345"
"5"
"99999"
etc. I need to make them all as long as the longest one "99999", so they should look like "00123", "00005", etc.
If these strings are stored in an array A[], then how can I do this padding? I will be knowing the biggest strings length.
I need to automate this process.
for ( int i = 0; i
|
|
|
|
|
use CStrings if u can
CString urString;
in the loop:
urString = a [i];
CString t( '0', numberOfSpaceNeeded );
t += urString;
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|