|
Hi ! I want to development a file system filter driver, in VC++. Can it be developed using DDK kit? or I will have to purchase the IFS kit? Plz specify what needs to be installed for file system filter development? Would be the DDK enough? Can I develop it in VC++ using the DDK?
|
|
|
|
|
Can any body help me to convert std::string to char * ?
Thanks in advance.I am working on win32(UNICODE)api in vs2005.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Use the c_str() member function:
std::string strMyString = "Test";
char* pTemp = strMyString.c_str();
|
|
|
|
|
amitmistry_petlad wrote: Can any body help me to convert std::string to char * ?
Use string::c_str .
e.g
std::string sTest("Test");
const char* ptest = sd.c_str();
Prasad
MS MVP - VC++
|
|
|
|
|
prasad_som wrote: const char* ptest = sd.c_str();
of course should be sTest.c_str() .
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.
|
|
|
|
|
Prasad
MS MVP - VC++
|
|
|
|
|
Hi
I am writing a class as below
class A
{
public :
virtual void display()
{
cout<<"Test";
}
};
class B: public class A
{
public:
virtual void print()
{
cout<<"test2";
}
void display()
{
cout<<"Test";
}
};
How many Virtual pointers will be there and how many VTables will be there. What will be the entries in the VTables.
|
|
|
|
|
Hi
As your have not created any object for any of the class A and B , I cant say how many VTables is created.
For Class A one virtual Table is created. It will contain the Address of display() function of Class A.
For Class B one virtual Table is created. It will contain the Address of print() function of Class B and Address of display() function of Class B.
We can create any no of VPTR but the VTables created is only one for each class which has atleast one virtual function or derived from an class which consists of atleast one virtual function.
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
Thanks . But if i create two objects for class A will I have two VPTRs or 1 VPTR ?
|
|
|
|
|
AFAIK, Virtual Pointer is part of Object which is created on object construction. The first 4 bytes of an object contains (Visual C++) the virtual pointer and this pointe will be linked to vtable of the class.
Virtual Table contains the address of functions of class (per class entity) within the binaries while virtual pointer belongs to each object so in your case there will be one vtable and two vptrs
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
But if i create two objects for class A will I have two VPTRs or 1 VPTR ?
Two vptrs. Generally, a single vptr for per object. But they all show to the same vtable [of class A].
--
======
Arman
|
|
|
|
|
Two VTables are created, one for A, one for B.
The same VTable is used for all instances of a class, i.e. all instances of A use the A VTable, all instances of B use the B VTable.
The A VTable will have 1 entry: A::display
The B VTable will have 2 entries: B::display, B:print
Once a method is declared virtual the same function signature is virtual in all derived class' regardless of whether the virtual keyword is used.
In Visual studio the VTable is called __vfptr in the debugger 'Locals' and 'Watch' views.
The debugger may not show all entries, but you can use the address in a memory window and look at see the list of function address' (null terminated list).
[EDIT]
Each instance of an class that has a VTable will start with a pointer to that VTable, but from a developer point of view the start of the object is the first developer defined member.
[/EDIT]
...cmk
Save the whales - collect the whole set
|
|
|
|
|
|
Hi,
I m trying to complile a code. Some errors are there and I m not able to understand why it is so please help me. Errors are
error C2061: syntax error : identifier 'StdDDECallback' c:\pankaj\STDDDE.C
error C2059: syntax error : ';' c:\pankaj\STDDDE.C
error C2059: syntax error : 'type' c:\pankaj\STDDDE.C
error C2065: 'StdDDECallback' : undeclared identifier c:\pankaj\STDDDE.C
error C2061: syntax error : identifier 'StdDDECallback' c:\pankaj\STDDDE.C
error C2059: syntax error : ';' c:\pankaj\STDDDE.C
error C2059: syntax error : 'type' c:\pankaj\STDDDE.C
error at this point
HDDEDATA FAR PASCAL __export StdDDECallback(WORD wType, WORD wFmt, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hData, DWORD dwData1, DWORD dwData2);
The Definition is
HDDEDATA FAR PASCAL __export StdDDECallback(WORD wType,
WORD wFmt,
HCONV hConv,
HSZ hsz1,
HSZ hsz2,
HDDEDATA hData,
DWORD dwData1,
DWORD dwData2)
{
HDDEDATA hDdeData = NULL;
switch (wType) {
case XTYP_CONNECT_CONFIRM:
//
// Add a new conversation to the list
//
AddConversation(hConv, hsz1);
break;
case XTYP_DISCONNECT:
//
// Remove a conversation from the list
//
RemoveConversation(hConv, hsz1);
break;
case XTYP_WILDCONNECT:
//
// We only support wild connects to either a NULL service
// name or to the name of our own service.
//
if ((hsz2 == NULL)
|| !DdeCmpStringHandles(hsz2, ServerInfo.hszServiceName)) {
return DoWildConnect(hsz1);
}
break;
case XTYP_ADVSTART:
case XTYP_CONNECT:
case XTYP_EXECUTE:
case XTYP_REQUEST:
case XTYP_ADVREQ:
case XTYP_ADVDATA:
case XTYP_POKE:
if (DoCallback(wType,
wFmt,
hConv,
hsz1,
hsz2,
hData,
&hDdeData)) {
return hDdeData;
}
//
// Fall Through to allow the custom callback a chance
//
default:
if (ServerInfo.pfnCustomCallback != NULL) {
return(ServerInfo.pfnCustomCallback(wType,
wFmt,
hConv,
hsz1,
hsz2,
hData,
dwData1,
dwData2));
}
}
return (HDDEDATA) NULL;
}
Pankaj Jain
|
|
|
|
|
Keyword __export is obsolete. Use _declspec(dllexport) instead.
Prasad
MS MVP - VC++
|
|
|
|
|
Hey,
The problem to ur solution is that
if StdDDECallback is a library function then u must include the coressponding library and the .H file at the top of ur program
or if it is a user defined function then ur have to give the prototype of that function.
Regards,
Pankaj Sachdeva
|
|
|
|
|
how to make a standard code. pls help me.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
What do you mean by STANDARD CODE?
If I get you correctly you are looking for some coding standards. You should look out for some manual that contains the coding standards, read through it and later abide by them.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
yes i need some manual to make my code a standard one. what are all the conditions for a standard code
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Look out for High-Integrity C++ Coding standard manual somewhere here. I hope this helps you out.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
hi,
how can i open a dao database (.mdb) in an VC++ application.And sfter that how can i copy a record to another location whenever i click that record.
Thanks
|
|
|
|
|
trang1800 wrote: how can i open a dao database (.mdb) in an VC++ application
Well, Microsoft recommends you don't (DAO will not be supported in the future, and there's
better technologies available).
DAO is not a database. It provides a way to access databases.
Here's a great place to learn: Data Access Programming[^]
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi.
I am having this error and I don't know what to do with it.. Please help.
error C2440: 'initializing' : cannot convert from 'class CDocument *' to 'class CVector_3DDoc *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
When I double clicked on the error, it points to this code: CCVector_3DDoc* pDoc = GetDocument();
What is wrong with this code? class CVector_3DDoc is a class that I have added with the base class as CDocument. Thanks.
|
|
|
|
|
ReturnRain wrote: What is wrong with this code?
The compiler is telling you exactly what is wrong.
CCVector_3DDoc* pDoc = (CCVector_3DDoc *) GetDocument();
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|