|
You could use the Visual Frameworks by Zoran M Todorovic (can be found at CodeGuru, http://www.codeguru.com/advancedui/VisualFx.shtml). Put each of your view options in a view tab in a tabbed view. Just a suggestion.
good luck
Steen.
|
|
|
|
|
Is there a one data type in c++ can hold any type of data(string,integral,float...) like a Variant data type in Visual basic .
I found a VARIANT type but it is must determine the type u would like before use it like this:
VARIANT v;
v.vt = VT_BSTR;
But what if there is a function can accept unexpected data type(For example some times string ,some times integral and so on...)
Can any body help me.
|
|
|
|
|
You were on the right track. VARIANTs are the type to use. In fact, they're the type that VB's Variants are based on. You can use them as parameters to functions (and you'll find you have to for many COM calls):
void MyFunction(VARIANT avtSomeValue)
{
switch (avtSomeValue.vt)
{
case VT_I4:
...etc
}
There is also a wrapper class called _variant_t which allows you to create MOST VARIANT types (unfortunately not all), and also provides a method called ChangeType which can be used to change the type of the variant. Personally, I find it easier to create the _variant_t objects as I need them:
if (i_want_a_string)
{
_variant_t vvtString("Some String");
MyFunction(vvtString);
}
else if (i_want_an_int)
{
_variant_t vvtInt(123, VT_I4);
MyFunction(vvtInt);
}
else
{
_variant_t vvtFloat(123.456, VT_R8);
MyFunction(vvtFloat);
}
There are also a whole pile of API functions which can help manipulate and convert VARIANTs. Try looking in MSDN for VarI4FromBstr or similarly named functions. There are also comparison functions such as VarCmp.
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
But you can not use function like this:
int n;
MyFunction(n);
and the call it like that:
char s;
MyFunction(s);
yu will get an error.
|
|
|
|
|
You can use function templates to manipulate different kinds of data in the same function.
|
|
|
|
|
is there a library or function on visual c++ that lets you obtain or record voice samples? if yes, where can we find that? otherwise, is there a way to access the sound card of the PC and program it accordingly?
|
|
|
|
|
|
Hay
reading a lot about shell extentions, i still didn't find a way to extend Explorer by "catching" file selection (LEFT click on a file ) and do something in response to it.
any ideas how to do it?
(ho, and FileManager Extentions are only for Win3.11 ?)
|
|
|
|
|
How can I turn the MFC Doc/View Window into a Dialog style window so only the X is there instead of, Minimize, Maximize, and Close(X)?
|
|
|
|
|
It's amongst the properties in the dialog editor.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
Override CWnd::PreCreateWindow() thus:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX);
return CFrameWnd::PreCreateWindow(cs);
}
--Mike--
http://home.inreach.com/mdunn/
A recent survey reports that 1/4 of all internet users in England surf for porn.
The other 3/4 just didn't want to admit it.
|
|
|
|
|
Please I need help!
-JOURNEYMAN-
|
|
|
|
|
You sure need help. You probably mean you want to use DirectDraw to animate objects onto a display, but unless you're more specific, it's kind of hard to know.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
|
Hi
Can anyone tell me what would cause the following error:
"Microsoft Visual Runtime Library - Runtime Error - Program d:myprog.exe - abnormal program termination"
The error is occuring in a released product developed using Visual C++/MFC, on some users Microsoft Windows 2000.
So far I've tested on MS Win 2000 and MS Win 2000 Service Pack 1.
It would help if I new why this error was occuring and how to fix it.
Cheers
Keith Avery
KA Technology
|
|
|
|
|
Sounds like you either
a/ needed to debug a bit more or
b/ don't have something installed you are depending on, like MDAC.
Can you duplicate the problem on a development machine ? If not, run depends to find out what you need, and figure out what you're missing.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
I agree I need to debug the problem a bit more.
It's all very frustrating as the product version was launched over a year ago, and only now are some Win2000 users getting problems.
I haven't been able to duplicate the problem yet with a clean installation of Win 2000.
|
|
|
|
|
I'm ok with buttons when programming Dialog stuff, but when it come to Doc/View structure program, I'm stuck...
Please help me code the buttons below...
A minimize button, and close button...
Thanks for any help...
|
|
|
|
|
Presuming that you're trying to get CButton type controls on a CView based window...
.... you should probably use CFormView for your view class.
|
|
|
|
|
I'm trying to select a row in my CListCtrl at runtime, but I just can't get it to work.
this->m_myList.SetSelectionMark(0);
int test = this->m_myList.GetSelectionMark();
It seems like the selection is successful, since 'test' always becomes 0. But the row is not being selected! What am I doing wrong here...
Sprudling
|
|
|
|
|
>>> From MSDN >>>
The selection mark is the item index from which a multiple selection starts
<<<
To select an item, you should use the SetItemState() member.
wndMyListCtrl.SetItemState ( 0, LVIS_FOCUSED | LVIS_SELECTED );
BTW: there is no need to prefix you statements with this->, it is assumed.
Ben Burnett
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
I want to create setup an install files of my program to a customer with the installShield software .
Who can guide me shortly how to do it.
|
|
|
|
|
There is a tutorial in : http://www.cs.duke.edu/~jjw2/installshield.html
|
|
|
|
|
I need to know how to delete only the first integer from a file ?
Who can help me ???
|
|
|
|
|
Read the entire file into a buffer, then write it back minus the first part.
Ben Burnett
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|