|
vcprog wrote: error C2511: 'bool CMy4Dlg::GetDisksProperty(HANDLE,PSTORAGE_DEVICE_DESCRIPTOR)' : overloaded member function not found in 'CMy4Dlg'
Check whether the signature of CMy4Dlg::GetDisksProperty() is exactly same in header and in cpp file?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
modified on Tuesday, August 19, 2008 5:20 AM
|
|
|
|
|
Hello everyone,
I am inserting vb activex control in VC program.In VB ocx program i am passing variables of type recordset from database.when i am inserting this ocx into my VC program those recordset datatypes are converting as LPDISPATCH* type. and my variables of type CRecordset. it is giving error like this:
C:\Program Files\Microsoft Visual Studio\My Projects\RecordSetPgm\RecordSetPgmDlg.cpp(255) : error C2664: 'Processattendacne' : cannot convert parameter 1 from 'class CRecordset' to 'struct IDispatch ** '
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
VB ocx Code is like this:
void C_UserControl1::Processattendacne(LPDISPATCH* rs, LPDISPATCH* rs1, BOOL* blnprocess)
{
static BYTE parms[] =
VTS_PDISPATCH VTS_PDISPATCH VTS_PBOOL;
InvokeHelper(0x60030000, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
rs, rs1, blnprocess);
}
And VC++ Code is like this:
database.Open(NULL,false,false,sDsn); // Open Clients.MDB
CRecordset recset( &database );
SqlString="SELECT field1 FROM sample";
recset.Open(CRecordset::dynamic,SqlString,CRecordset::readOnly);
CRecordset recset1(&database);
Client= "SELECT field2 FROM sample";
recset1.Open(CRecordset::dynamic,Client,CRecordset::readOnly);
m_UserControl.Processattendacne(recset,recset1,bstr);
database.Close();
please tell me what type of parameters i have to take and how should i declare those please tell me...please Help me out..i am trying this but i am not getting...please give me some suggestions..
Thanks in Advance,
Savitri
|
|
|
|
|
|
hii
It is only with simple program but i am passing variable to activeX control to do the operations like adding ,deleting etc..It is not taking of type recodeset directly..so tell me what data type i have to use..
please see my code..I pasted my code in my first message please will u tell me how to do this ..
HELP ME OUT..
Thanks in advance,
savitri
|
|
|
|
|
CRecordset is an MFC class which is not IDispatch compatible. VB ActiveX method that you are using, requires an IDispatch interface as parameter. If you use ActiveX Data Object (ADO) instead of CRecordset class then you will be able to pass the object to your VB ActiveX methods. I have included the link to samples in my previous post. These will help you get started.
I hope this helps.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hii,
If so please tell me how to do the connections and which header files i have to include please..I dont have idea adout ADO..I am using access database.will you tell me about connection and all..i am doing that only ok..
Please help me out...
Thanks in advance,
Savitri
|
|
|
|
|
Please see the links from my previous post. Following might also help Using ADO from VC++[^]
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Are you allergic to following directions? He's provided you with what you require...twice.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi All
I want to develop a USB Small project which show all information about USB Device like USB Device name,drive name and file or folder name.Plz help me..
|
|
|
|
|
|
|
OK. So you are using SetupAPI to query USB information. I believe, once you get hold of the device you can use the regular CreateFile, ReadFile, FindFirstFile etc API
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
can you give me some example..
Plz help me
|
|
|
|
|
|
thax's Sohail Kadiwala
it is working..thx's once again..
|
|
|
|
|
Glad I could help.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
i have a problem to add these values in listbox.Problem is that i want to show according data.I mean first i want to show drive name then it's data then other drive name then it's data. Right now it is showing but mixed shoe.Code is here
[code]
DWORD dwDrives=GetLogicalDrives();
if(0==dwDrives)
{
// return FALSE;
}
DWORD dwCount=0;
char chDriveLabel='A';
char szRootpath[5]={0,0,0,0,0};
while(dwDrives !=0)
{
if ((dwDrives & 1) != 0)
{
sprintf(szRootpath,"%c:\\",chDriveLabel);
//removable drive
if(DRIVE_REMOVABLE==GetDriveType(szRootpath))
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
//Removable dirve lable
// std::cout <<"Files in " << szRootpath << std::endl;
m_ListCountries.ActivateTopParent();
m_ListCountries.AddString(szRootpath);
AfxMessageBox(szRootpath);
//* represent search all files and directories
szRootpath[3]='*';
hFind=FindFirstFile(szRootpath,&FindFileData);
if (INVALID_HANDLE_VALUE == hFind)
{
// return FALSE;
}
// List all the files in the directory .
do
{
//ignore the sub directories
if (!(FindFileData.dwFileAttributes &
FILE_ATTRIBUTE_DIRECTORY))
{
// std::cout << FindFileData.cFileName << ":";
m_ListCountries.AddString(FindFileData.cFileName);
// m_ListCountries.UpdateData(false);
AfxMessageBox(FindFileData.cFileName);
}
}while (FindNextFile(hFind, &FindFileData) != 0);
FindClose(hFind);
}
}
dwDrives = dwDrives >> 1;//next drive
chDriveLabel++;
}
[/code]
plz help me..
|
|
|
|
|
|
|
ex. I am address from memory is : char *s = "0x003c2750". I want get value of s ?
|
|
|
|
|
|
Naveen wrote: char cValue = *s
may be with a semi-column too.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Jijo raj wrote:
may be with a semi-column too.
compiler role will come to play than [ ]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Well, s value is just 0x003c2750 .
Possibly you need *s value.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[Image resize DLL]
|
|
|
|
|
i think everyone is missing the point stated in the qns.
the qns states that
char* s = "0x12345567"
which is a null terminated string
and the poster wants to get the value of the memory 'pointed' by the string (not the pair of quotes around the address.
Thus *s will not work.
what you need to do is to parse the char* into a int or long (depending on whether it's 32bit or 64bit)
I believe this is what you wanted (thou it's almost 5 mths late )
char* s = "0x0012ec08";
char* stopString;
long address = strtol(s,&stopString,16);
void* pPointer = (void*)address;
depending on what is the value you want, you will then type cast pPointer to whatever type, for example
byte* pByte = (byte*)pPointer;
|
|
|
|