|
Did u google.
Величие не Бога может быть недооценена.
|
|
|
|
|
Yes, i googled .. but i cant find the source code written with openGL vc++ 2008
|
|
|
|
|
Just refer this link to get an idea[^]
Just refer this link to get the sample source code in c++ [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi,
I need to know how can i pass the type _Connection (or _ConnectionPtr) as parameter in function in the IDL file ?
This is some lines of code :
Test.cpp
_Connection *pConn = NULL;
IDataExtract->get_ADOConnectionObject(&pConn);
IDL file
[id(38), helpstring("get connection")] HRESULT get_ADOConnectionObject([in, out] ???????????????);
thank you for help.
|
|
|
|
|
If you import ADO into your IDL file (try using importlib with the ADO type-library), then you can use _Connection*, i.e. an interface pointer.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i have include ADO type-library like this:
importlib("C:\Program Files\Fichiers communs\System\ado\msado15.dll");
in the Library section
and i had wrote :
[id(38), helpstring("get connection")] HRESULT get_ADOConnectionObject([in, out] _Connection** pConnptr);
but it display error :
Error 1 error MIDL2009 : undefined symbol : _Connection [ Parameter 'ppAdoConnection' of Procedure 'get_ADOConnectionObject' ]
So how can resolve this problem ?
thank you
|
|
|
|
|
This works for me:
import "oaidl.idl";
import "ocidl.idl";
[
uuid(D39DD965-FC96-4C0A-AA62-CA3F5F117685),
version(1.0),
helpstring("cccc 1.0 Type Library")
]
library ccccLib
{
importlib("c:\Program Files\Common Files\System\ado\msado15.dll");
[
object,
uuid(7CD26371-4A6B-4234-A024-6690A53CA450),
nonextensible,
helpstring("Itest Interface"),
pointer_default(unique)
]
interface Itest : IUnknown
{
HRESULT DoSomething([in]_Connection* c);
HRESULT GetCount([in]_Recordset* rs, [out]int* num);
};
importlib("stdole2.tlb");
[
uuid(F8AAE058-76E9-4F2C-995A-FB5B6565CED6),
helpstring("test Class")
]
coclass test
{
[default] interface Itest;
};
};
Alternatively, remove the importlib statement and add
import "MSADO15.idl";
either in or out of the library's scope. Both of these have worked for me
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I will be crazy
the problem still with me !!! i have done all but no result for me !!!
|
|
|
|
|
Can you post more of your IDL? I wonder if there's something else causing this not to work
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
#pragma once
import "oaidl.idl";
import "ocidl.idl";
[
uuid(DADD8BCB-AAE5-4E88-9K06-1C991A2B77E4),
version(1.0),
helpstring("DllService Type Library")
]
library DllService Lib
{
importlib("C:\Program Files\Fichiers communs\System\ado\msado15.dll");
importlib("stdole2.tlb");
[
uuid(EC6DA8D8-DB33-4b29-BBED-8BDDC055D1E4),
version(1.0),
helpstring("Enum for UserType: enGroupType(0) - Group, enUserType(1) - User, enAdministaratorType(2) - Administrator")
]
typedef enum EUserType
{
enGroupType = 0,
enUserType = 1,
enAdministaratorType = 2
} _EUserType;
.
.
.
[
uuid(38570D0E-A46E-4A43-85DB-2A305D7667A7),
helpstring("_SAC_Session Class")
]
coclass _SAC_Session
{
[default] interface _ISAC_Session;
};
.
.
.
};
.
.
.
interface _ISAC_Session;
.
.
.
[
object,
uuid(148359B4-5D7E-4B7F-82F3-0E8FDBDA0D5D),
dual,
nonextensible,
helpstring("_ISAC_Session Interface"),
pointer_default(unique)
]
interface _ISAC_Session : IDispatch{
.
.
.
[id(24), helpstring("get ado connection")] HRESULT get_ADOConnectionObject([in,out] _Connection **ppAdoConnection);
};
i hope that can you find something.
|
|
|
|
|
Spotted it. You define _ISAC_Session OUTSIDE the library, so it cannot see the ADO definitions brought in by the importlib statement, as that is wihtin the library definition.
Changing the importlib to an import statement OUTSIDE the library definition will fix your error. Here's the sample code you posted, modified so it'll work. I've highlighted the import statement I added.
#pragma once
import "oaidl.idl";
import "ocidl.idl";
<big>import "msado15.idl";</big>
[
uuid(DADD8BCB-AAE5-4E88-9306-1C991A2B77E4),
version(1.0),
helpstring("DllService Type Library")
]
library DllServiceLib
{
importlib("stdole2.tlb");
[
uuid(EC6DA8D8-DB33-4B29-BBED-8BDDC055D1E4),
version(1.0),
helpstring("Enum for UserType: enGroupType(0) - Group, enUserType(1) - User, enAdministaratorType(2) - Administrator")
]
typedef enum EUserType
{
enGroupType = 0,
enUserType = 1,
enAdministaratorType = 2
} _EUserType;
[
uuid(38570D0E-A46E-4A43-85DB-2A305D7667A7),
helpstring("_SAC_Session Class")
]
coclass _SAC_Session
{
[default] interface _ISAC_Session;
};
};
interface _ISAC_Session;
[
object,
uuid(148359B4-5D7E-4B7F-82F3-0E8FDBDA0D5D),
dual,
nonextensible,
helpstring("_ISAC_Session Interface"),
pointer_default(unique)
]
interface _ISAC_Session : IDispatch{
[id(24), helpstring("get ado connection")] HRESULT get_ADOConnectionObject([in,out] _Connection **ppAdoConnection);
};
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you very much for your help.
One more thing i would ask, this statment have no effect in other classes if i use a rename_namespace?
like Internal ?
|
|
|
|
|
I've got no idea - sorry.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
THANK YOU VERYYYYYYYYYY MUCH
it work
you saved me really
|
|
|
|
|
Good - glad I could help!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I'm surprised today when i build my dll and i have found many error almost are like this:
c:\sac\see_ac_services\debug\msadox.tli(245) : error C2065: '_result' : undeclared identifier
and the same error for other types like :
c:\sac\see_ac_services\debug\msadox.tlh(495) : error C2327: 'ADOX::_Index::Properties' : is not a type name, static, or enumerator
I don't know where is the mistake, i dont know how can i find the solution for this !!!!!!!
Have you an idea ?
|
|
|
|
|
Sounds like you need to #import the dependencies of your library - try adding the auto_search attribute to your #import statement.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Please can you explain more for me, i don't understand you ?
|
|
|
|
|
You're obviously using #import somewhere to reference a type library (the .tli and .tlh makes that quite clear). Here's a #import (for Excel) that uses auto_search:
#import "libid:00020813-0000-0000-C000-000000000046" auto_search
Replace the libid I've used with the type library reference you're using.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
you mean that i replace libid:00020813-0000-0000-C000-000000000046 by msado15.idl ?
|
|
|
|
|
msado15.idl? No.
I'm not talking about your IDL file any more. Somewhere in one of your .cpp files, there is a #import statement that defines a reference to a COM object. THAT #import statement is the one that needs modification.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Yes , i havelike this:
#import "C:\Program Files\Fichiers communs\System\ado\msado15.dll" rename_namespace("Internal") rename( "EOF", "EndOfFile" )
#import "C:\Program Files\Fichiers communs\System\ado\msadox.dll"
so can you help me how do this ?
Thank you
|
|
|
|
|
I had put auto_search in all #import statements in dll cpp files but also i have the same problem !!!!
Have you any idea please?
|
|
|
|
|
Really don't know - those two #import lines compile fine on my machine
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I read data from a bmp file,and use it as a texture,but it just failed,which work well on others' computer,My code is no problem.Any help is appreciated .Thanks!
|
|
|
|