|
but if that was the problem, he would have an error such as "Class already defined"...
but the compiler says that the class is NOT defined, even with the header include...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
billiam904 wrote:
Boss doesn;t want to use namespaces.
Then don't tell him/her that you can't get away from using the global namespace!
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Wish I could. He wants me to do it the way he tells me to do it.
Would I have to include the .NET framework if I use namespaces?
|
|
|
|
|
Bill Dennis wrote:
Would I have to include the .NET framework if I use namespaces?
No. Namespaces have nothing to do with the .NET framework. It's just the name of a declarative region in your code. All programs use (or have use of) the global namespace. If you use STL, you will see references to the std namespace.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I just put your three files into an existing project and it compiled fine. The problem must lie with code that has not been shown.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I am attempting to paste some code here but due to contract restrictions, I can't paste it all.
sharewaredlg.h:
#if !defined(AFX_SHAREWAREDLG_H__609C8E03_67C4_11D3_A859_00000E00ECA4__INCLUDED_)
#define AFX_SHAREWAREDLG_H__609C8E03_67C4_11D3_A859_00000E00ECA4__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "RegisterDlg.h"
#include "WavRead.h"
class CSharewareDlg : public CDialog
{
};
class CDemoAudio
{
private:
CWavRead m_cWavRead;
public:
BYTE *ReadDemoIntoBuffer();
void PlayBuffer(BYTE *pDemoBuffer, WAVEHDR *hdrDemo, DWORD dwDataBufferSize);
BYTE *GetDemoBuffer();
DWORD GetDemoSize();
protected:
// variables
DWORD dwOutDataSize;
BYTE* m_pbyDemoBuffer;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SHAREWAREDLG_H__609C8E03_67C4_11D3_A859_00000E00ECA4__INCLUDED_)
SingleDlg.h:
#if !defined(AFX_SINGLEDLG_H__B2588407_6984_11D1_A856_444553540000__INCLUDED_)
#define AFX_SINGLEDLG_H__B2588407_6984_11D1_A856_444553540000__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// Shareware stuff
#include "SharewareDlg.h"
struct THREADPARMS_RECORD
{
CWnd *pWnd;
CSingleAlg *pckSingleAlg;
CWavWrite *pWavWrite;
CWavRecord *pWavRecord;
// BD 10/05 ADDED PARM FOR CWAVREAD
CWavRead *pWavRead;
// BD 10/05 ADDED DEMO PARMS.
CDemoAudio *pDemoAudio; // error here undefined class.
BYTE *pbyDemoBuffer;
int *pnRegLevel;
// =========================
BYTE *pbyBuffer;
int *pnBufferSize;
CString *pstrCurFile;
CString *pstrCurFilePath;
CEvent *pEvent;
CCriticalSection *pCriticalSection;
int *pnStop;
};
class CSingleDlg : public CDialog
{
protected:
// Program variables
CSingleAlg m_ckSingleAlg;
CWavWrite m_cWavWrite;
CWavRecord m_cWavRecord;
CWavRead m_cWavRead;
// =========DEMO====================
// Demo variables BD 10/05
CDemoAudio m_cDemoAudio; // Error here. m_cDemoAudio utilizing Undefined class.
// =================================
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SINGLEDLG_H__B2588407_6984_11D1_A856_444553540000__INCLUDED_)
|
|
|
|
|
It's *got* to be something in my SharewareDlg.h file because I moved my class to a separate file and it worked fine. Thanks.
Bill Dennis
|
|
|
|
|
Check to see if you have a copy of SharewareDlg.h in some other directory in the include path. You might be adding your class in a different file than the one the compiler is picking.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I fixed the problem by moving my class to the very beginning of SharewareDlg.h before the if !defined statement.
Thanks, guys.
|
|
|
|
|
Anonymous wrote:
I fixed the problem by moving my class to the very beginning of SharewareDlg.h before the if !defined statement.
I think you fixed the symptom, not the problem...
Anonymous wrote:
Thanks, guys.
You're welcome.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi all,
I'm working on an application that preferably has to send a mail to the user once in a while while it's running. Problem is that it really also has to be able do this when the pc is connected to the internet through another account (other ISP).
The question is: how can I do this as flexible as possible?
- Sending the info with HTTP GET or POST works fine, uses port 80 which is usually open already, but needs some kind of PHP script installed on a webserver to accept the info and mail it. This is the disadvantage (not so user friendly).
- Using local computer settings (SMTP server) to mail from within the app works too, but won't necessarily work anymore when the pc is connected through another internet account. For example, my ISP only allows to use their SMTP server. So I can not use the one from my hosting company. If I connect my pc somewhere else, with an internet account not from my ISP, then my settings won't work.
- Could I use a built-in SMTP sever in my app? Are there ways to make sure the mail can be sent, no matter which ISP account is used (see problem above)? Won't a built-in SMTP server be blocked frequently by firewall settings? Can you mail through more standard ports (80?) instead?
- Or should I just let the user configure more SMTP servers and let the app traverse the list until it finds one that works?
I hope you see what I want to do and what my problem is.
Any suggestions are greatly appreciated!
SonOfGrey
-- modified at 5:22 Friday 7th October, 2005
|
|
|
|
|
Hi again!
I now have another (simple) problem!
I have a dialog box with a listbox control on it, which has been loaded with several strings. I want to be able to select a string, and then delete it by pressing the <delete> key. I havnt been able to detect any key being pressed. What do I need to do?
I have used MFC Classwizard to add message handlers for WM_KEY_DOWN and WM_KEY_UP, but it doesnt seam to work - where am I going wrong?
Thanks yet again!
|
|
|
|
|
You can subclass the control. Create message handler for WM_KEYUP message:
void ..... OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if (nChar == VK_DELETE)
{
}
CListBox::OnKeyUp(nChar, nRepCnt, nFlags);
}
Maybe there are better ways.
this is this.
|
|
|
|
|
Hi Khan++
Thanks for your help - yep thats got it now!
Thanks again
Mike
|
|
|
|
|
Is anybody developing apps/components that are OPC compliance. I just wanted to know if OPC is still alive and it's used as standard for industrial client / server applications.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
OPC clients are developed all the time at Wonderware - www.wonderware.com
Many third parties write OPC clients as well and OPC servers for the PLC devices.
|
|
|
|
|
I just wondered if OPC is the main protocol/standard that is used for inustrial communications. Thanks for ithe info.
What are trends in this item, I mean, are there any other teck or standard that some companies are investing ?
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
I try to open a table "Customer" and select a specific record of it with the Open property as follows:
m_pSet->Open(CCustomer::dynaset,"SELECT NAME FROM CUSTOMER WHERE ID = 5"
This command throws the following exception error:
"Invalid character value for cast specification"
Does anyone know what have I done wrong and how to make it work properly?
Thanks in advance
|
|
|
|
|
Did you try m_pSet->Open(CRecordSet::dynaset,_T("SELECT NAME FROM CUSTOMER WHERE ID = 5")) ?
The great error of nearly all studies of war has been to consider war as an episode in foreign policies, when it is an act of interior politics - Simone Weil
Fold with us! ¤ flickr
|
|
|
|
|
Yes I already tried it.
I saw that this was because in the DoFiledExchange() the first field must be of the same type with the requested one in the Select clause.
Thanks very much for your time!
Any idea?
|
|
|
|
|
|
OK I found why this error occured.
This was because in the DoFieldExchanged() I have all the fields of the table, so the Open() should be with NULL value at the second argument (LPCTSTR lpszSQL=NULL).
So, I tried the following:
m_pSet = new CDatabaseSet;
m_pSet->m_strFilter = "ID = 48";
m_pSet->Open(CDatabaseSet::dynaset);
Now the problem is that it works properly when the filter has a field of numeric type.
When it is of character type it doesn't work properly.
It returns the last record even if it shouldn't return anything.
Any idea on why this happens???
Thanks again for your help!!!
|
|
|
|
|
I need to check the security permissions over a folder(which means i need to iterate over the ACE's from the DACL)and check whether the logged in user has some permissions over them.
Heres how i approached this problem -
1)I am using GetFileSecurity() function to get the Security descriptor for
this folder.
2)Next i check whether this descriptor is valid using IsValidSecurityDescriptor().It returns TRUE.
3)Next, i am using the function GetSecurityDescriptorDacl() to get the DACL.
4)The second parameter to this function is an out parameter (a pointer to a bool)which is set to TRUE if DACL is present.
IT is here that in this out parameter i am getting a FALSE value.
What does this imply(coz right clikin the folder to retrieve the security permissions i can get a DACL)
please help
Anmol
-- modified at 7:44 Friday 7th October, 2005
|
|
|
|
|
hi!
i am working on an MFC SDI Application. I have an EditBox on a dialog for dispalying path of files. I hav also used a Button for browsing files.
My Browse button is working , but, i also want that "the path of the file can be entered directly into the edit box." How to do it?
But, I had not used EditBox earlier as i am new to mfc programming. can anybody help me at this issue.
Thanx for providing me help
|
|
|
|
|
CString strPath<br />
GetDlgItemText(IDC_EDIT_PATH, strPath);<br />
P.
|
|
|
|