|
What's your MIDL command line, and your INCLUDE environment variable?
It looks like it can't find the imported IDL file, which is normally in the INCLUDE directory, by default \Program Files\Microsoft SDK\Include or in the VC include directory, \Program Files\Microsoft Visual Studio\VC98\Include.
Steve S
|
|
|
|
|
yeah, for tht I have set the environment variable too.
now if I type PATH in DOS prompt, following is the output:
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Microsoft Visual Studio\VB98;C:\Program Files\Microsoft Visual Studio\VC98\Bin;C:\Program Files\Microsoft Visual Studio\VC98\Include;
but still the same problem.
thanks,
Ashok
|
|
|
|
|
But it isn't meant to go in PATH, it's meant to go in INCLUDE...
|
|
|
|
|
You can either set the INCLUDE environment variable as appropriate, or use the /I option to indicate directories to be searched.
If you're launching MIDL as part of a Visual C++ project build, it should inherit the same include directories settings from Tools > Options > Directories (VC6) or Tools > Options > Projects > VC++ Directories (VS.NET). These are usually set correctly.
VC6 configures the include directories (the INCLUDE environment variable) for the copy of the Platform SDK that it installs, when it installs, if requested. VS.NET does not automatically do this - to set the appropriate directories, run vsvars32.bat (in Common7\Tools under the VS.NET directory), or use the "Visual Studio .NET Command Prompt" shortcut in the start menu (under Visual Studio .NET Tools).
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I have done tht too. but still the problem exists.
I am giving everything in details, I have done here. please let me know, if you can find out, where I have gone wrong.
1. in VC++6.0, I have created a text file and saved it as FirstSrv.idl. content of the file is:
import "oaidl.idl";<br />
[<br />
object,<br />
uuid(1E2F24ED-0317-4990-A29D-55FB73908C68)<br />
]<br />
interface IFirstInterface : IUnknown<br />
{<br />
HRESULT DoSomething();<br />
};<br />
<br />
[<br />
uuid(4619C849-67DC-4f24-B5D2-0E215B1DBD6A),<br />
version(1.0)<br />
]<br />
library FirstTypeLib<br />
{<br />
importlib("stdole32.tlb");<br />
[<br />
uuid(C69DA526-39B4-4810-803B-43A9F9AC5376)<br />
]<br />
coclass FirstComponent<br />
{<br />
[default] interface IFirstInterface;<br />
};<br />
};
2. in Tools->Options->Directories
i. under include files
C:\PROGRAM FILES\DXSDK\INCLUDE
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\PRERELEASE
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\INCLUDE
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\MFC\INCLUDE
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\ATL\INCLUDE
C:\WIN32
ii. under library files
C:\PROGRAM FILES\DXSDK\LIB
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\LIB
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\MFC\LIB
C:\WIN32
C:\PROGRAM FILES\MICROSOFT SDK\LIB
C:\PROGRAM FILES\MICROSOFT SDK\LIB\PRERELEASE
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE
3. I have 3 copies of oaidl.idl in my system. they are under the following directories:
i. C:\Program Files\Microsoft Visual Studio\VC98\Include
ii. C:\Program Files\Microsoft SDK\Include\prerelease
iii.C:\Program Files\Microsoft SDK\Include
Hope, I have made everything clear on whtz goin on this side. and when I try the following:
MIDL FirstSrv.idl
result comes as:
Microsoft (R) MIDL Compiler Version 5.01.0164
Copyright (c) Microsoft Corp 1991-1997. All rights reserved.
Processing .\FirstSrv.idl
FirstSrv.idl
midl : command line error MIDL1001 : cannot open input file oaidl.idl
Hope u r clear now on whtz goin this side.
Expecting ur kind response.
regards,
Ashok
|
|
|
|
|
In your command window, have you run VCVARS32.BAT ?
This will set stuff like LIB and INCLUDE for you, although it may not be 100% correct, it will have all the VC++ directories.
Steve S
|
|
|
|
|
Ohhhhhh.... really I m very very thankful to you Steve...
it works now...
Once again Thank you very much.
regards,
Ashok
|
|
|
|
|
Hi All,
I have a windows service installed on Machine having XP2 Service pack 2 OS.
I am using this call in Run() Method,
hr = CoInitializeSecurity(NULL, -1, NULL, NULL,
RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL_IMPERSONATE, NULL,
EOAC_NONE, NULL);
If i access this service from other computer it gives access denied error.
If i disable Firewall security from Control Panel->Windows Firewall,and in Dcomcnfg add ANONYMOUS user and give it full access,
access denied problem goes.
Why do i want to add ANONYMOUS in Dcomconfg even i disable Firewall security??
if i dont want to do all above settings but still my service should be accessed from other computer ,what should i do,is there any way for this??
Any help is appreciated.
Thanks
Tushar Mahajan.
|
|
|
|
|
Hi,
I have developed an application, which supports File save / read logic using Structure Storage (mentioned on this site). I am storing very complicated structure in the file. Now I want to support typical file versioning system. So that even if I changed (add new elements in present structure), till it should be able to support backward file reading capabilities.
Does anyone has come accross such senario? How the design was done in this senario? My present design is - It will call say GetDataFor130() or GetDataFor100() (where 130 means ver 1.30, 100 means ver 1.00.) GetDataFor130() will internally call GetDataFor100() and then read or write the additional elements. So backward compatibility is maintained with minimum code complexity.
Thanks & Regards,
Anonymous
|
|
|
|
|
I learning to make a COM dll, I want convert a a sample in C++ (or C i dont know) I just need help with the
[odl,
uuid(A70D81F2-C9D2-4053-AF0E-CDEA39BDD1AD),
helpstring("IMediaStatusSession Interface"),
dual,
oleautomation]
the best i could do so far learing from the SDK is:
[Guid(A70D81F2-C9D2-4053-AF0E-CDEA39BDD1AD),
InterfaceType(ComInterfaceType.????????),
helpstring("IMediaStatusSession Interface")]
I just need help with the "dual" and "oleautomation"?
where can i find info about this in the SDK Documentation? or even better can some one fix what i done so far.
modified 16-May-21 21:01pm.
|
|
|
|
|
Please any body tell me How to minimize the size of ATLCOM DLL. I have made dll which is MTS supported + Asp intrinsic objects. I have made 5 functions in One interface. and the size of dll is 1.04 MB...
Please tell me how could i minimize the size of the dll.
Thanks in advance...
|
|
|
|
|
Visual C++ 6.0's ATL wizard creates two different release configurations: ReleaseMinSize and ReleaseMinDependency. The minimum dependency version links to the C run-time statically and includes the ATL registration code. The minimum size version links to the DLL version of the C run-time and links to atl.dll for registration.
In the second case, you would have to distribute msvcrt.dll (installed by default on Windows 2000 and later, so you can skip it if you're targetting one of these systems) and atl.dll.
You can select different combinations by defining (or not defining) the symbols _ATL_MIN_CRT , _ATL_STATIC_REGISTRY , and changing the C run-time library version you're using. If you're not using the C run-time at all, you can define _ATL_MIN_CRT .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi all,
I have created a simple FULL control, also i have registered a new MIME type for it.
Now, When i create a new file say test.myext and open it with IE. it show the Control taking full page on IE Window and spying these window -
It looks something like this
---C:\temp.bisfext
|---Other Windows
|---Other Windows
|--- Shell DocObject View
|-Internet Explorer_Server
But I have seen some few application where in if you embed you control in IE Window then IE Show something Like
---C:\temp.bisfext
|---Other Windows
|---Other Windows
|--- Shell DocObject View
|-Internet Explorer_Server
|-ATL:XXXXXXXX
Can anyone please explain me what is the difference between the two?
Thanks in Advance
Abhishake
|
|
|
|
|
Hi,
How do I find out the the path of the .exe or script file (.vbs, .js) which is trying to use my ActiveX server exe?
Any VB or VC++ code will be helpful.
Thanx
|
|
|
|
|
Hi,
I am student. Right now i am learning on COM+. And doing one on course project in VC#.NET and COM + component. This is distributed application.
In that there is server on one machine and client on other. But i am little bit confused in that server client techonlogy. I have to make database connectivity for validating users and other inforamation. That time i creat on clint and one server and one component for connecting client to server. But if i want to make one more form can i use same server that i already created for the login. and how to use many forms to connect server and then connect to database i am confused in this stuff.
Please Help me.
I hope someone help me for that
Thanking You,
(Hemant Uttam Mane)
|
|
|
|
|
I am a COM newbie, and I would like to use the MAPI address book in one of my apps.
According to the documentation I got, the function I want is IAddrBook::Address .
Now IAddrBook is declared as IAddrBook : IMapiProp which tells me it is derived from IMapiProp .
My question is how do I get an instance of IAddrBook into my MFC app so that i can use it?
The interface ID is IDD_IAddrBook and the pointer type is LPADRBOOK which are declared in in the file "MAPIX.h" which is all fine, but to use CoCreateInstance() to create an instance of IAddrBook I need a class ID. What is, or where do I find, the CLSID for IAddrBook . Or is there an other way to load an instance of IAddrBook ?
Please do not point me to WABOPen as that function will return Internet Explorer's cutdown subset of MAPI's IAddrBook interface. I want to gain access to MAPI's full featured IAddrBook .
Also, if anyone can recommend some good books on COM basics for beginners, I would be greatful
Thanks.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
__uuidof(IAddrBook)
will this work for you?
Have you considered using smartpointers, since you are a newbie as you said, it would be helpful for you.
God is Real, unless declared Integer.
|
|
|
|
|
Thanks for the pointer, but unfortunately it does not work
LPADRBOOK pa = NULL;
HRESULT hr = CoCreateInstance(__uuidof(IAddrBook), NULL, CLSCTX_INPROC_SERVER, IID_IAddrBook, &pa); gives me
error C2787: 'IAddrBook' : no GUID has been associated with this object Surely there must be a way to load an IAddrBook object
It can't be that difficult, all I need is point in the right direction
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I am not that expert in com either, but i guess this should work.
HRESULT hr = CoCreateInstance(IDD_IAddrBook, NULL, CLSCTX_INPROC_SERVER, IID_IAddrBook, &pa);
before that , did you import the tlb file ?
God is Real, unless declared Integer.
|
|
|
|
|
hi
clsid for IAddrBook is {4D2F086C-6EA3-101B-A18A-00AA00446E07}. I just took it from the registry. but it seems mapi.dll is supposed to use by calling the exported mapi functions in that dll. Even if the dll is com compliant, it is not iDispatch impliemnted and also it exports a large number of functions for varuois kind of operations with outlook. So it better to go for that built in functions than the com functions. So to get the IAddrBook pointer u can use pSession -> OpenAddressBook . This will return LPADRBOOK . To get a valid pSession variable, call MAPIInitialize and MAPILogonEx .
rgds...mil10
|
|
|
|
|
Thanks, this may be just what I need to get started
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
HI all,
Plz anyone can tell me where to get any online tutorials to start learning COM?I am new to it and need ur help.Plz help me
Poornima
|
|
|
|
|
got to ATL/WTL...u will find beginners 5 articles...
|
|
|
|
|
http://www.codeproject.com/atl/#Beginners
at least madam give search or do look at left hand side bar of Codeproject for titles
cheers
Balkrishna
|
|
|
|
|
Question:
How to return SafeArray inside of Variant from COM component?
My COM component is out-of-process component ie.EXE and client
is coded in VB. I am building communications interface for
VB clients and have a need to return array of bytes.
Passing of Variant arry to COM-component thru IDispatch is ok and
returning of parameters that are not arrays is also working.
Any help is warmly welcomed!
Example code from idl which tries to return array thru inVal - parameter:
[id(7), helpstring("method to Test3 interface with Variants")] HRESULT get_Test3( [in, out] VARIANT *inVal, [out, retval]VARIANT *pVal);
Declaration on C++ :
STDMETHOD(get_Test3(/*[in, out]*/ VARIANT *inVal, /*[out, retval]*/ VARIANT *pVal);)
And Implementation:
STDMETHODIMP TestClass::get_Test3(/*[in, out]*/ VARIANT *inVal, /*[out, retval]*/ VARIANT *outVal){
ZeroMemory(inVal, sizeof(VARIANT));
BYTE dummyInput[3] = {0,1,2};
CDispatchHelper::ConvertFromBytePtr2Variant(dummyInput,&inVal);
return S_OK;
}
And implementation of ConvertFromBytePtr2Variant() - fucntion
//Converts given byte array to SAFEARRAY contained in Variant.
//NOTE: Now this just creates array of 100 ints for testing purposes
BOOL CDispatchHelper::ConvertFromBytePtr2Variant(BYTE *_byteToConvert, VARIANT **_ppResult)
{
SAFEARRAY *pNewSafeArray = NULL;
// one dimensional array with 100 elements and
// zero-based indexing
SAFEARRAYBOUND rgb [] = { 100, 0 };
// allocate the memory for the descriptor
// and the array data
pNewSafeArray = SafeArrayCreate(VT_I4, 1, rgb);
if (pNewSafeArray) {
// get ptr to array base
long *rgelems;
SafeArrayAccessData(pNewSafeArray, (void**)&rgelems);
// initialize each element
for (int c = 0; c < 100; c++)
rgelems[c] = c;
// release lock on array state
SafeArrayUnaccessData(pNewSafeArray);
}
//Now we have safe array in pNewSafeArray
//Put array in Variant
*_ppResult = new VARIANT;
if (*_ppResult == NULL){
ATLASSERT(FALSE);
return FALSE;
}
ZeroMemory(*_ppResult, sizeof(VARIANT));
(**_ppResult).vt = VT_I4 | VT_ARRAY;
(**_ppResult).parray = pNewSafeArray;
return TRUE;
}
VBClient side code is this:
Dim testInOut As Variant
testOut = oIdiootti.get_Test2(testInOut)
'Here value of testInOut is not changed, if transaction were succesfull
'parameter should contain 100 integers with values 0,1,2,3...
|
|
|
|
|