|
Ok, next errors
#pragma once
class CBaseRenderer;
class CD3DBase
{
private:
CBaseRenderer gRenderer;
};
And here the errors:
e:\C++\DXProject\CD3DBase.h(46) : error C2079: 'CD3DBase::gRenderer' uses undefined class 'CBaseRenderer
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You're missing #include "BaseRenderer.h" or you can make gRenderer a pointer.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
tried both. this eliminated all errors, except that now I get this one again:
e:\C++\DXProject\CBaseRenderer.h(5) : error C2504: 'CD3DBase' : base class undefined
#pragma once
#include "CD3DBase.h"
class CBaseRenderer : public CD3DBase
{ ...
but well...since I only need a pointer to an IDirect3DDevice9 from CD3DBase, I might also create a function to pass this one as a parameter and make CBaseRender not to inherit from CD3DBase.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
you have a dependecy loop.
"a.h" file includes "b.h"
and "b.h" file includes "a.h"
when you derive the derivated class has to know the type tou derive from so you need the definition of the type not the declaration
of that type.
|
|
|
|
|
How come that this line will compile in VS 6.0 but not in VS 7.0?
strOut += strData[iPos] ^ strKey[iKeyPos++];
strOut, strData and strKey are Cstring.
IPos and iKeyPos is int.
I got the compiler error: C2593: 'operator +=' is ambiguous (watch my code)
Thanks
_____________________________
...and justice for all
APe
|
|
|
|
|
d00_ape wrote:
How come that this line will compile in VS 6.0 but not in VS 7.0?
Actually, with warning level 4, VS6 also complains.
d00_ape wrote:
I got the compiler error: C2593: 'operator +=' is ambiguous (watch my code)
Of the various CString += operators, more than one of them matches the strData[iPos] ^ strKey[iKeyPos++] return value. Does this help:
strOut += (char) (strData[iPos] ^ strKey[iKeyPos++]);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
DavidCrow wrote:
strOut += (char) (strData[iPos] ^ strKey[iKeyPos++]);
It really helped. And still work with that XOR. THANKS!!
_____________________________
...and justice for all
APe
|
|
|
|
|
Don't know why you get the error but try this:
strOut += strData[iPos];<br />
strOut += strKey[iKeyPos++];
Could be that this works. (else you still can use strOut.append(...))
Good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
He lost the XOR operation this way
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi..
Plz help me..
How to Hide column from listview.
even one drag width of other col. then it'll not display..
means... if we setWidth=0, then even your cannot show that fields..
Bye
---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
Hi
I am calling a dialog box including a list control window.
This dialog box has computer names in local network.
I'ts using 'WNetOpenEnum' and 'WNetEnumResource' APIs.
Now I have used this code successfully in Windows 2000/XP.
But these codes got empty in Windows 98.
Nothing in list control.
Is a problem of network setting or not enough APIs to get names?
How can I do that?
anyone any ideas ?
Help me plz.
---- source list ---
void CNetworkDlg::SearchLocalPc(void)
{
// WNetOpenEnum parameter
DWORD dwScope = RESOURCE_CONTEXT;
NETRESOURCE *NetResource = NULL;
HANDLE hEnum;
// WNetOpenEnum for Windows 98. but Nothing in return value
unsigned long strWNetMSG = WNetOpenEnum(dwScope, RESOURCETYPE_ANY, NULL, NULL, &hEnum);
// for error
switch(strWNetMSG)
{
case NO_ERROR:
break;
case ERROR_NOT_CONTAINER:
AfxMessageBox("ERROR");
break;
case ERROR_INVALID_PARAMETER:
AfxMessageBox("ERROR");
break;
case ERROR_NO_NETWORK:
AfxMessageBox("ERROR");
break;
case ERROR_EXTENDED_ERROR:
AfxMessageBox("ERROR");
break;
default :
AfxMessageBox("ERROR");
return ;
}
// SOCKET creation
WSADATA wsaData;
WSAStartup(MAKEWORD(1, 1),&wsaData);
// if WNetOpenEnum success
if (hEnum)
{
// for WNetEnumResource
DWORD dwCount = 0xFFFFFFFF;
DWORD dwBufferSize = 16384;
LPVOID lpBuffer = new char[16384];
// continues a network-resource enumeration but Nothing in return value
unsigned long strWNetResourceMSG = WNetEnumResource(hEnum, &dwCount, lpBuffer, &dwBufferSize);
NetResource = (NETRESOURCE*)lpBuffer;
// for error
switch(strWNetResourceMSG)
{
case ERROR_MORE_DATA:
AfxMessageBox("ERROR");
break;
case ERROR_INVALID_HANDLE:
AfxMessageBox("ERROR");
break;
case ERROR_NO_NETWORK:
AfxMessageBox("ERROR");
break;
case ERROR_EXTENDED_ERROR:
AfxMessageBox("ERROR");
break;
default:
break;
}
if(m_ListSearchPc.GetItemCount() != 0)
m_ListSearchPc.DeleteAllItems();
m_dwCountTotalPc = 0;
for(unsigned int i = 0; i < dwCount; i++, NetResource++)
{
if (NetResource->dwUsage == RESOURCEUSAGE_CONTAINER && NetResource->dwType == RESOURCETYPE_ANY)
{
if (NetResource->lpRemoteName)
{
CString strFullName = NetResource->lpRemoteName;
if (strFullName.Left(2).Compare("\\\\") == 0)
strFullName = strFullName.Right(strFullName.GetLength() - 2);
if(strFullName.IsEmpty())
continue;
// 1. add number to list contorl
CString pcNo;
pcNo.Format("%d", m_dwCountTotalPc + 1);
m_ListSearchPc.InsertItem(m_dwCountTotalPc, pcNo);
// 2. add pc aname to list control
strFullName.MakeLower();
m_ListSearchPc.SetItemText(m_dwCountTotalPc, 1, (LPCTSTR)strFullName);
m_dwCountTotalPc++;
}
}
}
delete lpBuffer;
WNetCloseEnum(hEnum);
}
WSACleanup();
CString total;
total.Format("%d", m_dwCountTotalPc);
CString PopupMessage;
PopupMessage = "Number of Total Pc :";
PopupMessage += total;
SetDlgItemText(IDC_TEXT_LOCALPC_EA, LPCTSTR (PopupMessage));
UpdateData(FALSE);
}
|
|
|
|
|
When you say "nothing in return value," does that mean that WNetOpenEnum() is returning NO_ERROR ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes. WNetOpenEnum() is returning NO_ERROR.
|
|
|
|
|
I did not find anything exceptionally wrong. See if any of these minor changes make a difference:
void CNetworkDlg::SearchLocalPc(void)
{
WSADATA wsaData;
CString strText;
DWORD dwResult = 0,
dwCount = 0xffffffff,
dwBufferSize = 16384,
dwIndex = 0;
int nItem;
LPNETRESOURCE lpNetResource = NULL;
HANDLE hEnum;
LPVOID lpBuffer;
m_ListSearchPc.DeleteAllItems();
dwResult = WSAStartup(MAKEWORD(1, 1), &wsaData);
if (0 == dwResult)
{
dwResult = WNetOpenEnum(RESOURCE_CONTEXT, RESOURCETYPE_ANY, NULL, NULL, &hEnum);
if (NO_ERROR == dwResult && NULL != hEnum)
{
lpBuffer = new BYTE[dwBufferSize];
dwResult = WNetEnumResource(hEnum, &dwCount, lpBuffer, &dwBufferSize);
if (NO_ERROR == dwResult && dwCount > 0)
{
lpNetResource = (LPNETRESOURCE) lpBuffer;
while (dwIndex < dwCount && NULL != lpNetResource)
{
if (RESOURCEUSAGE_CONTAINER & lpNetResource->dwUsage && RESOURCETYPE_ANY == lpNetResource->dwType)
{
if (lpNetResource->lpRemoteName)
{
strText.Format(_T("%lu"), dwIndex);
nItem = m_ListSearchPc.InsertItem(dwIndex, strText);
strText = lpNetResource->lpRemoteName;
if (_T("\\\\") == strText.Left(2))
strText.Delete(0, 2);
strText.MakeLower();
m_ListSearchPc.SetItemText(nItem, 1, strText);
dwIndex++;
}
}
lpNetResource++;
}
strText.Format(_T("Number of Total PC: %lu"), dwIndex);
SetDlgItemText(IDC_TEXT_LOCALPC_EA, strText);
}
delete [] lpBuffer;
}
dwResult = WSACleanup();
}
if (dwResult != 0)
{
strText.Format(_T("Error: %lu"), dwResult);
m_ListSearchPc.InsertItem(0, strText);
}
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
hi all
i use the below to create a modeless dialog which works ok
CCPServerWait* m_pWaitDlg;
m_pWaitDlg = new CCPServerWait;
m_pWaitDlg->Create(IDD_DCPSERVER_WAIT);
m_pWaitDlg->m_wait_mes = "Connecting to CMIS Please
m_pWaitDlg->UpdateData(FALSE);
m_pWaitDlg->ShowWindow(SW_SHOW);
m_pWaitDlg->UpdateWindow();
m_pWaitDlg->DestroyWindow();
but before i use this code; i need to call the function
ok = SQLCreateDataSource(m_hWnd,"CP_CMIS_CON");
with this in, the code for the modeless dialog doesnt work
if i take it out then the code for the modeless dialog does work,
obviously i need it in, can ne1 help ???
si
|
|
|
|
|
si_69 wrote:
m_pWaitDlg->UpdateWindow();
There is no need to call UpdateWindow() here.
si_69 wrote:
the code for the modeless dialog doesnt work
Define "doesnt work." Have you single-stepped through each line of code?
The code you've shown does not appear to do anything other than create a dialog object and then destroy it. I can't imagine it being on the screen any longer than a quick flash, if that long. The last time I used one, there was some (lengthy) processing going on in between the calls to ShowWindow() and DestroyWindow() .
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=857875&df=100&fr=101#xx857875xx
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Does anyone know how to detect a CDatabase disonnection?
I'm inserting rows into a database and when it disconnects it throws a CDBException with return code of type 'SQL_ERROR'. This is the same error code for all SQL errors e.g. primary key violation etc.
I want to detect a disconnection, then attempt a reconnect but can't figure out how to specifically detect a disconnection?
Can anyone help?
|
|
|
|
|
What really happen when I convert my VS 6.0 (C++) project to a VS .NET project. May I then take advantage of some .NET “stuff”?
Are there any reason for me to start using VS .NET except for a nicer editor?
All tips are welcomed!
_____________________________
...and justice for all
APe
|
|
|
|
|
What really happen when I convert my VS 6.0 (C++) project to a VS .NET project. May I then take advantage of some .NET “stuff”?
Only if your existing project uses it, or else .NET won't be called.
Are there any reason for me to start using VS .NET except for a nicer editor?
My personal opinion,
Pros: Better compiler and linker (claimed that the executables generated by VC7 run faster than VC6 in Dr Dobb's Journal), better STL conformance, upgraded debugger.
Cons: Slower interface compares to VC6, no more class wizard.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Anthony_Yio wrote:
no more class wizard
I've found that irritating too. Anyway, I guess I still can do all that class-wisard did in some other way?
_____________________________
...and justice for all
APe
|
|
|
|
|
Anyway, I guess I still can do all that class-wisard did in some other way?
Of course, there are. Just that the functions are not in the same place. A few ways to access the class wizard functions. In VS 2003, I am not sure of others. One, is via your properties window - control event button when you have selected your resources, this allow you to select the event handler you need.
and second, is by right click on your resources. You will notice, Add Varible or Add Event Handler menu enabled.
For more details, check out their dynamic help.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Good to hear! Tahnks
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi,
I would like to connect do a DSN (data source name) through my code in C++, but I don't want to write the UserName and Password in my code: how can I do??
Here it is my code:
static bool IsSubscribed(SQLCHAR Account[], bool& subscription, bool& warning)
{
SQLHENV henv = NULL;
SQLHDBC hdbc = NULL;
SQLHSTMT hstmt = NULL;
SQLRETURN sRet;
PTSTR szDataSource = _T("DSN_NAME");
PTSTR szUID = _T("UserName");
PTSTR szPWD = _T("Password");
// Initialize the ODBC environment.
if (SQLAllocHandle(SQL_HANDLE_ENV, NULL, &henv) == SQL_ERROR)
{
WriteIntoFile("ERRORE Initialize the ODBC environment");
return false;
}
SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void*) SQL_OV_ODBC3,SQL_IS_INTEGER);
// Allocate a connection handle and connect to the data source.
if (SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc) == SQL_ERROR)
{
WriteIntoFile("ERRORE Allocate a connection handle");
return false;
}
if (SQLConnect(hdbc, (SQLTCHAR*) szDataSource, SQL_NTS,
(SQLTCHAR*) szUID, SQL_NTS, (SQLTCHAR*) szPWD, SQL_NTS) == SQL_ERROR)
{
WriteIntoFile("ERRORE Connect to the DataSource");
return false;
}
// Get a statement handle and execute a Transact-SQL SELECT statement
if (SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt) == SQL_ERROR)
{
WriteIntoFile("ERRORE Get a statement handle and execute a Trans-SQL");
return false;
}
SQLINTEGER cbAccount = SQL_NTS;
// ? marks the input parameter.
sRet = SQLPrepare(hstmt, (SQLCHAR*) "{call spIsSubscribed(?)}", SQL_NTS);
// Bind the input parameter.
sRet = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR,
SQL_CHAR, 20, 0, Account, 0, &cbAccount);
if( (SQLExecute(hstmt)) == SQL_ERROR)
{
WriteIntoFile("ERRORE Execute");
return false;
}
bool sub;
SQLINTEGER cbSub;
bool warn;
SQLINTEGER cbWarning;
// Retrieve data from row set.
SQLBindCol(hstmt, 1, SQL_C_BIT, (SQLPOINTER) &sub, 0, &cbSub);
SQLBindCol(hstmt, 2, SQL_C_BIT, (SQLPOINTER) &warn, 0, &cbWarning);
sRet = SQLFetch(hstmt);
if(sRet != SQL_SUCCESS && sRet != SQL_SUCCESS_WITH_INFO)
{
WriteIntoFile("ERRORE Fetch");
return false;
}
subscription = sub;
warning = warn;
/* Clean up.*/
SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
SQLDisconnect(hdbc);
SQLFreeHandle(SQL_HANDLE_DBC, hdbc);
SQLFreeHandle(SQL_HANDLE_ENV, henv);
return true;
}
|
|
|
|
|
Hi..
I don't have much time to see your code but
One thing u can do is supply coneection string...
that's very easy...
Use class CDatabase
CRecordset
or drive class from CRecordset & supply all information at creation time...
I'm in hurry...
so see..u later..
bye..
---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
Why not wrap all of that ODBC nastiness into a class? I have been using the same ODBC classes for about 8 years now, and never had a problem. If you want the classes, shoot me an email.
onwards and upwards...
|
|
|
|
|