|
Hello everyone!
OK, here's my code:
<br />
void ParseFile(CString);<br />
<br />
BxBeep * beeps;
<br />
int numOfBeeps;
It gives me:
BipFile.h(40): error C2059: syntax error : 'constant'
Why is that? Thanks!
PS: This is inside a class declaration.
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
Is BxBeep defined?
Look at the previous line too. Often the actual error is in the line before the one flagged by the compiler.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Shots do not hurt other players... yet
|
|
|
|
|
|
Well, that's not surprising since every Win32 app uses kernel32.dll But that's a linking step, not a compiling step. You have to work out the compile errors before worrying about libs.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
#include "witty-quote.h"
|
|
|
|
|
AAAAAAAHH!!!
I changed line 40 from "beeps" to "beepCol", but look at the whole collection of errors:
---------------------------
BipFile.obj : error LNK2005: "public: __thiscall BeepXtreme::BipFile::BipFile(class ATL::CStringT<char,class strtraitmfc_dll<char,class="" atl::chtraitscrt<char=""> > >)" (??0BipFile@BeepXtreme@@QAE@V?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) already defined in BeepXtremeDlg.obj
BipFile.obj : error LNK2005: "private: void __thiscall BeepXtreme::BipFile::ParseFile(class ATL::CStringT<char,class strtraitmfc_dll<char,class="" atl::chtraitscrt<char=""> > >)" (?ParseFile@BipFile@BeepXtreme@@AAEXV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) already defined in BeepXtremeDlg.obj
BipFile.obj : error LNK2005: "public: struct BeepXtreme::BxBeep __thiscall BeepXtreme::BipFile::GetBeep(int)" (?GetBeep@BipFile@BeepXtreme@@QAE?AUBxBeep@2@H@Z) already defined in BeepXtremeDlg.obj
BipFile.obj : error LNK2005: "public: int __thiscall BeepXtreme::BipFile::GetNumOfBeeps(void)" (?GetNumOfBeeps@BipFile@BeepXtreme@@QAEHXZ) already defined in BeepXtremeDlg.obj
BipFile.obj : error LNK2005: "public: void __thiscall BeepXtreme::BipFile::PlayBeep(int,bool)" (?PlayBeep@BipFile@BeepXtreme@@QAEXH_N@Z) already defined in BeepXtremeDlg.obj
BipFile.obj : error LNK2005: "public: static void __cdecl BeepXtreme::BipFile::PlayBeep(unsigned int,unsigned int)" (?PlayBeep@BipFile@BeepXtreme@@SAXII@Z) already defined in BeepXtremeDlg.obj
BipFile.obj : error LNK2005: "public: static void __cdecl BeepXtreme::BipFile::PlayBeep(unsigned int,unsigned int,unsigned int)" (?PlayBeep@BipFile@BeepXtreme@@SAXIII@Z) already defined in BeepXtremeDlg.obj
Debug/BeepXtreme.exe : fatal error LNK1169: one or more multiply defined symbols found
---------------------------
Can anybody please look at my code? I'm going crazy here...
http://sulfurmidis.com/beepxtreme.zip
Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
Kixdemp wrote: Can anybody please look at my code? I'm going crazy here...
http://sulfurmidis.com/beepxtreme.zip
Thanks!
I was going to, just for giggles if nothing else, but you really should cut the size of the download down a bit. 4.30MB is simply too large for my 28kbs dialup connection. If you drop any executables and intermediary files, and include as small a sample data file as is needed to test the app I may have another go at it.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
Ok, to get a clean compile I had to change two lines in your code
File BeepExtremeDlg.cpp line 12
#include "BipFile.cpp"
to
#include "BipFile.h"
line 121 - The buffer that is used by itoa() has to allocated before it is used
char * buf;
to
char buf[10] = {0};
The program still crashes, but it is now logic errors, not syntax errors.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
Hello,
Does anyone know anything about classless ip addresses / subnetting with regards to the Windows Socket Api? Is there anything special that needs to be done in the code to support this?
Thanks,
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
I dont think WinSock 1 and WinSock 2 either of them dependent
on the type of subnetting.
|
|
|
|
|
Hi all,
Fairly new to this so bear with me...I have an app which, due to a Macromedia issue we have, crashes on an occasional basis. When it does I get the microsoft automatic error reporting dialog saying "Sorry but your application..blah blah....please send your error to Microsoft"
All I want to do is supress that Dialog so the user never sees it but no-one seems to know how to do it.
Any help would be greatly appreciated!
Thanks in advance
DM
|
|
|
|
|
hi
you can do as follows.
Right click on MyComputer.
then select Properties.
then select Advance tab.
then click on Error Reporting.
select Disable Error Reporting.
that is all.
sanket patel
|
|
|
|
|
That's just what I need - thanks very much!
Trouble is now...this app is going to run on 6000 machines around the UK, I'm going to have to do this in the code somehow I'll have a dig around and see what I can come up with.
Once again, thanks for your help.
|
|
|
|
|
Ha! Found the approprite registry key ...just going to modify that and I should be done
Thanks (again!!)
|
|
|
|
|
Hopefully these are turnkey systems, and not end-user systems since you are turning off this message for ALL programs running on the computer.
Now, supposing you actually caught program exceptions at some high level in your program, won't that ALSO stop the message from appearing?
|
|
|
|
|
Hi Blake, sorry for late reply, been away!
If the settings are correct, it only supresses the error message for a specified app which is just what we want.
As it happens, it turned out to be a hardware issue (sorry Macromedia ) which was easily resolved but you are right, the program exceptions would have worked as well.
Thanks for the help!
|
|
|
|
|
Hi,
Is there any way to passing back to the parent dialog values of the child's Dialog variables ?
For example :
CCreateCategoryDlg dlg;
if (dlg.DoModal() == IDOK)
{
// In this point i want the access the strings of the dlg.ListBox
}
Regards,
George
sdancer
|
|
|
|
|
You can add public member variables or functions to the CCreateCategoryDlg class that return the results. Here's an example:
public CMyDialog : CDialog {
public:
virtual void OnOK();
int GetResult();
private:
int Result;
};
void CMyDialog::OnOK()
{
Result = list_box.GetCurSel();
}
int CMyDialog::GetResult()
{
return Result;
} Note that you can't reference the list box in the function GetResult() . At this point, the dialog window and its child controls have already been destroyed. This is the reason for the OnOK() handler, which is called when the user clicks the OK button, before the dialog is destroyed. Save the contents of the controls in the OnOK() handler, and then return those saved results in the "Get*" functions.
Software Zen: delete this;
|
|
|
|
|
Hi,
Iam working with a ListControl whose parent is a dialog. In one the cell of the listcontrol,I place a tree control which on doubleclicking should open up & overlap the dialog control.
I achieved the treecontroloverlapping by writing as follows:
treeControl.SetParent(GetDesktopWindow());
treeControl.ShowWindow(true);
treeControl.BringWindowToTop();
treeControl.SetFocus();
treeControl.MoveWindow(500,300,400,200);
Now,the problem I have in hand is that the overlapped treecontrol is not active.Can't do anything over there.
Tried "EnableWindow","SetActiveWindow" etc.but the overlapped treecontrol is not getting enabled.
Any help is appreciated...
Thanks...
|
|
|
|
|
Why not make the tree control's parent the dialog instead of the desktop window?
Just insert it in Z-order after the list control so that it will appear in front of the list control.
|
|
|
|
|
HiBlake,
I fixed the problem..
I had to Modify the style after setting the parent
m_gridControl.SetParent(GetDesktopWindow());
m_gridControl.ModifyStyle(WS_CHILD,WS_POPUP);
Thanks
|
|
|
|
|
Is there any way to obtain the name of the caller function in VC++?
eg:
Func1()
{
Func2()
}
I need to get the name of Func1() from Func2() using code.
Any help would be appreciated.
Thanks,
John
|
|
|
|
|
Unfortunately, there's no way to do that directly. The compiler does create a #define symbol called __FUNCTION__ , that is the name of the current function. You could modify your code as follows:
void Func2(char *caller);
void Func1()
{
Func2(__FUNCTION__);
}
void Func2(char *caller)
{
TRACE(_T("Func2 called by %s.\r\n"),caller);
} Everywhere you call Func2 use Func2(__FUNCTION__); .
Software Zen: delete this;
|
|
|
|
|
Gary R. Wheeler wrote: The compiler does create a #define symbol called __FUNCTION__
is there something you need to do to enable this? or is this not available in VC6 ?
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|