|
Hi
Thank you very much.
I am looking for your e-mail.
-- modified at 2:21 Monday 6th August, 2007
|
|
|
|
|
Mark Salsbery wrote: an email, I'll send you (and anyone else interested) a VS2005 project
And for VS2003 email isnt work?;)
|
|
|
|
|
|
|
hi
i exactly follow what in KernelIoControl function's description in MSDN and elsewhere. i know that i've done no mistake. but it gives me the same Preset ID's and Platform ID's for more than one device. please don't tell me the same things in the documentations. just tell me what may be the problem. maybe a fault of manufacturer?
thx
|
|
|
|
|
In the resource edit box,what is the unit of the size which is shown at the bottom?
|
|
|
|
|
ifqf wrote: control the size of Dialog
Do you need to WM_SIZE ?
ifqf wrote: edit box
Do you need to MoveWindow ?
|
|
|
|
|
i'm not sure what your after?
size control is done via overriding WM_SIZE
which is called when the dialog is created and when its size is changes (takes Sizing events, minimise maximise etc).
in resource editor (in VS 05) you can find the size of the dialog or control you have selected in the bottom right conor by default which is in pixels.
does that cover the your question?
-- modified at 12:05 Sunday 5th August, 2007
|
|
|
|
|
ifqf wrote: In the resource edit box,what is the unit of the size which is shown at the bottom?
try handlling WM_GETMINMAXINFO
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Hello everyone,
The return value of CoCreateInstance is -2146232576, which is un-documented in MSDN.
http://msdn2.microsoft.com/en-us/library/ms686615.aspx
What does it mean? What is wrong with my code?
<br />
HRESULT hr = CoCreateInstance(CLSID_MyDriver,<br />
NULL,<br />
CLSCTX_INPROC_SERVER,<br />
IID_IMyDriver,<br />
reinterpret_cast<void**>(&driver_interface));<br />
<br />
if (FAILED(hr))<br />
{<br />
if (hr == REGDB_E_CLASSNOTREG)<br />
{<br />
printf("Couldn't create the instance!... 0x%x\n", hr);<br />
}<br />
else if (hr == CLASS_E_NOAGGREGATION)<br />
{<br />
printf("Couldn't create the instance!... 0x%x\n", hr);<br />
}<br />
else if (hr == E_NOINTERFACE)<br />
{<br />
printf("Couldn't create the instance!... 0x%x\n", hr);<br />
}<br />
else if (hr == S_OK)<br />
{<br />
printf("Couldn't create the instance!... 0x%x\n", hr);<br />
}<br />
else<br />
{<br />
printf("Couldn't create the instance!... 0x%x\n", hr);<br />
}<br />
}<br />
thanks in advance,
George
|
|
|
|
|
Interesting error
Maybe some clues here[^]
That's the most I could find.
MArk
*edit* fixed link
Last modified: 12mins after originally posted --
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark,
I have tried to register into GAC, but the error message is still the same. Any ideas?
regards,
George
|
|
|
|
|
/*
Try putting your CLSID and GUID in there
and see if this gets you going
*/
IMyDriver driver_interface;
// Class ID (GUID)
IID IID_IMyDriver;
::IIDFromString(L"{12345678-1234-1234-1234-123456789012}",
&IID_IDriver_Interface);
// CLSID
CLSID CLSID_IMydriver;
::CLSIDFromString(L"{98765432-9876-9876-9876-987654321098}",
&CLSID_MyDriver);
// When using CoCreateInstance
hr=CoCreateInstance(CLSID_IMydriver,NULL,CLSCTX_INPROC_SERVER,
IID_IMyDriver,(void**)&driver_interface);
if (SUCCEEDED(hr)) {
// Do something with driver_interface
}
|
|
|
|
|
Thanks bob16972,
I have tried your new method, but the error is the same. I suspect the DLL (which implements MyDriver class) is not loaded correctly. Do you think so? What is the check list?
regards,
George
|
|
|
|
|
Here are some ideas/questions based on past experiences with COM...
When you register/unregister the dll using "regsvr32.exe" from a "cmd" window, what message do you get?
Have you verified that the item shows up in "OLE View"? If you are using Visual C++ 6.0, "OLE View" is in the "Microsoft Visual C++ 6.0 Tools" in the program list.
You can also search HKCR (HKEY_CLASSES_ROOT) to verify the ProgID, CLSID, and classes are all there.
How did you create your MyDriver class in Visual C++?
Did you verify the CLSID and the class GUID are correct in your code? Always copy and paste them from "OLE View" to avoid any miskeying when not using the ProgID.
|
|
|
|
|
Thanks bob16972,
I have tried to write an executable and using the same code to utilize the function from the COM component, it works!
Previously, I wrote a COM (C++ unmanaged code), and use the C++ COM invokes another function from a C# COM (managed code), and it fails -- this is what I described at the beginning of this question -- "return value CoCreateInstance not documented in MSDN".
Any ideas? Why exe as a client works but DLL as a client does not work?
regards,
George
|
|
|
|
|
Hi all,
i am facing a problem while passing a reference as structure from one class member function to another class member function.
ie) i will pass a struct as input from Class A member function
to Class B member function. There in Class B member function
it has to fill the Structure and give me the filled structure
in Class A member function.
Note: this i am facing in vc++. i am having two dialog classes where i have to send this reference variable from first class member function to second Class member function.
please this very very urgent for me.
-- modified at 1:57 Sunday 5th August, 2007
Uday kiran
|
|
|
|
|
Can you show an example of the method declaration and how you were calling it?
What exactly is the problem that's occurring?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Either you pass the member function a pointer to the structure (&structvar), or make the receiving function accept the argument by reference (classname::member(structtype & structvar).
|
|
|
|
|
hi,
Thanks a Lot I get it.
Uday kiran
|
|
|
|
|
/*
Not dialog based but you should get what your
looking for here.
*/
#include "stdafx.h"
#include <stdio.h>
typedef struct
{
int nKey;
int nSize;
} MY_STRUCTURE;
class CBar
{
public:
CBar::CBar() {}
CBar::~CBar() {}
void CBar::DoSomething(MY_STRUCTURE& myStructure)
{
// Modify the structure
myStructure.nKey=45;
myStructure.nSize=99;
}
};
class CFoo
{
public:
CFoo()
{
Start();
}
~CFoo() {}
void Start()
{
CBar bar;
MY_STRUCTURE someStructure={0};
printf("BEFORE: nKey = %d, nSize = %d\n",
someStructure.nKey,someStructure.nSize);
bar.DoSomething(someStructure);
printf("AFTER: nKey = %d, nSize = %d\n",
someStructure.nKey,someStructure.nSize);
}
};
int main(int argc, char* argv[])
{
CFoo foo;
return 0;
}
|
|
|
|
|
hi,
Yes, i cought for this only and you have showed me path.
Thanks a Lot it exaclty what the problem i facing.
Uday kiran
|
|
|
|
|
uday kiran janaswamy wrote: Note: this i am facing in vc++. i am having two dialog classes where i have to send this reference variable from first class member function to second Class member function.
But what is the problem!.. hang, value is not updated or something else!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
hi all;
when i invoke the method below it delets all my objects from the list, can any one please tell me what i am doing wrong?
if there are 3 objects in the list and i am asking to delete the last one, it moves over all of the items but when it deletes the 3rd, it deletes them all..
thanks a lot,
Beri
bool cListAdv::remOneFromList ( long _unqAdvName )
{
if ( ListOfAdv.size() == 0 )
{
return false; // empty list
}
else
{
list<cAdv>::iterator iter ;
iter = ListOfAdv.begin() ; // set the iter to the begining of the list
while ( iter != ListOfAdv.end() ) // if it is not the end continue to check
{
cAdv tempAdv(*iter); // define a temporary adv and set it to the first object
//if (ListOfAdv.size() == 1 ) iter++; // change before deleting the same object - prevent mem error
iter++;
if ( tempAdv.getUnqAdvName() == _unqAdvName )
{
//ListOfAdv.remove( *iter ) ; // if they have the same AdvId remove - removes all objects from list
ListOfAdv.remove( tempAdv );
return true;
}
//++iter;
}
return false ; // not found
}
}
|
|
|
|
|
does cAdv have an == operator ?
lst.remove(x) deletes items from lst which match the value 'x'.
|
|
|
|