|
I did what you did:
void CMenuDlg::StartGame()
{
if (m_Games.GetLbText(m_Games.GetCurSel()) == "Tribes");
{
//Do somthing
}
}
Error:
C:\Dokumenter\C++\Menu\MenuDlg.cpp(184) : error C2039: 'GetLbText' : is not a member of 'CListBox'
c:\programmer\microsoft visual studio\vc98\mfc\include\afxwin.h(2741) : see declaration of 'CListBox'
Dosn't GetLbText belong to a combo box??
Thank's
|
|
|
|
|
"Dosn't GetLbText belong to a combo box??"
Yeah it does...and didn't I say that that post was written before morning coffee? And besides...what do you expect from free advice?
Make that m_Games.GetText(m_Games.GetCurSel()) and it shoudl work better.
|
|
|
|
|
if (m_Games.GetText(m_Games.GetCurSel()) == "Tribes")
{
//Do somthing
}
Only one error left
error:
Error C2661: 'GetText' : no overloaded function takes 1 parameters
Whats an overloaded function?? I got lots to learn
Ps. Am glad you help's me with this one
|
|
|
|
|
Am trying to make a tab control, but am new at programming, so i would like a litle help
ex: Where i could find Tutorials on a simple Tab Control.
Thank you very much
|
|
|
|
|
Anyone got an good sources of information on implementing USB functionality. Just looking for some decent reference material.
Thanks.
Joseph Dempsey
jdempsey@cox.rr.com
Joseph.Dempsey@thermobio.com
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."
--anonymous
|
|
|
|
|
Try www.usb.org and http://www.lvr.com/usb.htm
My next step would be to open up Copernic (www.copernic.com) and do a search for "USB development" etc..
Sorry I can't help any more...
|
|
|
|
|
I have a very annoying problem. I have two static classes, declared right after each other and somehow, I want them to be able to reach each other...
static class A : public Location
{
public:
Location *GetB { return &B; }
} A;
static class B : public Location
{
public:
Location *GetA { return &A; }
} B;
The code above is how I 'want' it to work.
Any help on this would be very appreciated.
Erik
|
|
|
|
|
First of all, let me say that I've never seen ANYONE declare a static class in the same manner as a struct typedef. I would recommend changing your code for clarity's sake, but that's now back to your question...
If you would like each class to access the other, I would recommend the following:
<br />
class A : public Location<br />
{<br />
public:<br />
static A instance;<br />
Location* GetB() { return &B::instance; };<br />
}<br />
<br />
class B : public Location<br />
{<br />
public:<br />
static B instance;<br />
Location* GetA() { return &A::instance; };<br />
}<br />
Hope this helps! (Basically, you create two singleton objects.)
|
|
|
|
|
You need to forward-declare class B before the definition of class A. (And BTW, your naming is confusing - a class "A" and a variable "A" together is a no-no if you care about readability.)
class B;
class A : public Location
{ ... } objectA;
class B: public Location
{ ... } objectB;
--Mike--
http://home.inreach.com/mdunn/
Time is an illusion; lunchtime doubly so.
|
|
|
|
|
Hi
does anyone have links or idea on different way of implementing an undo for my app...
thanks
Raphael mor
|
|
|
|
|
You have two options - maintain a list of copies to the entire document in different states, or maintain a list of actions that you can unperform.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
hi,
I have been trying to include a template class into a CList object but i it does not seem to work. I have tried to put in this way in the "Population" class:
Typedef Chromosome<cgene> chromosome
CList<chromosome,chromosome> PopulationArray;
Is there any way to put a template class into another template class??
I appreciate your help. Thank you.
leonwoo
|
|
|
|
|
I'm not having problems inserting template classes in a CList:
template <class t="">
class Cell {
public :
T SetData(const T& t) {
T old = data;
data = t;
return old;
}
T GetData() const {
return data;
}
private :
T data;
};
CList<cell<int>, Cell<int> > lst;//NOTE--there *must* be a space between the right-most braces : > >
lst.
Walter Gildersleeve
Freiburg, Germany
walter.gildersleeve@pe-gmbh.de
|
|
|
|
|
Thanks for your reply Walter,
can you please clarify what it means by CList ,Cell >1st.......>>1st
thank you
leonwoo
|
|
|
|
|
typedef Chromosome<CGene> chromosome;
CList<chromosome,chromosome> PopulationArray;
This should work fine. What error messages are you getting when you try this?
--Mike--
http://home.inreach.com/mdunn/
Time is an illusion; lunchtime doubly so.
|
|
|
|
|
Thanks for your reply,
The error message that i've got is "no copy constructor to copy the data type Chromosome<cgene>".
For now i can't remember the complete message but i will put it in after i've copied the message.
leonwoo
|
|
|
|
|
|
Hi!!
I am required to develop a Windows NT Service EXE in my project. While reading through MSDN, I came across the "ATL Service EXE" option when developing ATL components.
Could anybody please tell me the the difference between the two?
Which option is preferrable?
What factors does this selection depend on?
Please help me as I am new to VC++!!!
Thanks & Regards,
Nikhil.
(nkapre@hotmail.com)
Nikhil
|
|
|
|
|
What does compiler error 'Float Inexact value' mean? I'm using ATL and automation.
Thanks,
|
|
|
|
|
Hi,
I'm using a VB activeX dll for some string manipulatation stuff. This requires that from the client (VC) i pass strings to VB Dll. What datatype should I use? VB Variant seems to work good. From the client I'm using a CComBSTR to hold value.Ideally the data should be variant but is String also supported?
Thanks,
Amit.
|
|
|
|
|
|
Hi!
I have a video stored in a IStream, anyone know how to play this video without copy it to a file first. (Using an y version of the mediaplayer)
/Markus
Markus
|
|
|
|
|
my app contains a menu with two item.
the 1st item (MENU_ITEM_1), opens a tree, the second item (MENU_ITEM_2) opens a
dialog(1),
when the tree is opened by (MENU_ITEM_1), i made a selection on a tree-item that pops
up a dialog(2),
so i select from menu, MENU_ITEM_2 that pops up dialog(1),
my prblm is that when i reselect from menu MENU_ITEM_1, the tree appears but
the appropriate dialog no ( the MENU_ITEM_2 (dialog1) remains ) even if i send a
"brute"
TVN_SELCHANGED to the same ITEM.....to enforce the rigth dialog(2)...
this is portion of my code: ( in fact its not a menu but buttons that pops up dialog )
portion of code that catch TVN_SELCHANGED to display a dialog for each item:
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code)
{
case TVN_SELCHANGED:
hItem = TreeView_GetSelection(hTree);
tvi.mask = TVIF_PARAM|TVIF_TEXT;
tvi.hItem = hItem;
TreeView_GetItem(hTree,&tvi);
if ( tvi.lParam == 1 )
{
if ( hSkills == NULL )
hSkills =
CreateDialog(g_hInstance,MAKEINTRESOURCE(competences_cles),hWnd,(DLGPROC)Skills_Proc);
else SetFocus(hSkills);
}
...........
portion of code that catch the buttons selection:
case WM_COMMAND:
switch(LOWORD(wParam))
{
// the famous MENU_ITEM_2(dialog1)
if ( HWND(lParam) == (HWND)hJobsButton )
{
ShowWindow(hTree,SW_HIDE);
if ( hJobs == NULL )
hJobs = CreateDialog(g_hInstance,MAKEINTRESOURCE(emplois),hWnd,(DLGPROC)Jobs_Proc);
else SetFocus(hJobs);
}
// ***** MY PROBLEM MENU_ITEM_1(dialog2) *********
// *****************************************
if ( HWND(lParam) == (HWND)hMyResumeButton )
{
if ( hTree == NULL )
{
Create_Default_Tree(hWnd);
SetFocus(hTree);
}
else
{
ShowWindow(hTree,SW_SHOW);
SetFocus(hTree);
//TreeView_Select(hTree,hSkillsTree,TVGN_CARET);
//TreeView_Select(hTree,hItem,TVGN_CARET);
//SendMessage(hTree,TVM_SELECTITEM,TVGN_CARET,(LPARAM)hItem);
}
}
so can u help me please , i can't resolve it since a lot of time... :<
|
|
|
|
|
I am probably mangling my attempts at getting a PARAM value into my activeX control (MS VC++ 6).. I have set MayScript, etc. and the control works otherwise, But I can't figure out how to get the PARAM Values in... need simple strings available globally... An example project would be GREATLY appreceated!!!
|
|
|
|
|
// ----------- I declare a class constructor & destructor like this...
#include "afxdlgs.h"
class CEditSongListDialog : public CFileDialog
{
public:
CEditSongListDialog (BOOL bOpenFileDialog,
LPCTSTR lpszDefExt = NULL,
LPCTSTR lpszFileName = NULL,
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
LPCTSTR lpszFilter = NULL,
CWnd* pParentWnd = NULL);
~CEditSongListDialog ();
...
}
// ---------- And define them like this...
CEditSongListDialog ::CEditSongListDialog (BOOL bOpenFileDialog,
LPCTSTR lpszDefExt,
LPCTSTR lpszFileName,
DWORD dwFlags,
LPCTSTR lpszFilter,
CWnd* pParentWnd)
:CFileDialog (bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{
m_ofn.Flags |= OFN_EXPLORER | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_ALLOWMULTISELECT;
m_ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EDITSONGLIST);
m_ofn.lpstrTitle = "Edit Song List";
m_ofn.lpstrFilter = "*.MP3";
}
CEditSongListDialog ::~CEditSongListDialog()
{
UnhookWindowsHookEx (ESL_HookHandle);
nOnceOnly = 0;
}
// -------------- Then I get error message like this...
Compiling...
EditSongListDialog.cpp
Linking...
RR_SWallDlg.obj : error LNK2005: "public: virtual __thiscall CEditSongListDialog::~CEditSongListDialog(void)" (??1CEditSongListDialog@@UAE@XZ) already defined in EditSongListDialog.obj
Debug/RR_SWall.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
// ------------- The question is "what wrong with my program ???"
|
|
|
|