|
Hello,
I am getting very unique problem till now I haven't got any solution for this problem. I am describing the problem hope I will get solution from you.
I have created one ATL COM Component, this in turns call a third party library API which provide mapping solution. The main work of this COM Component is to create dynamic map upon request. I made this component to work with our ASP.net application. For testing purpose I have created a Standalone application in C# also. In my development machine this ATL COM Component runs fine with standalone application as well as in ASP.net Application. It instantiates then it instantiates third party 7Cs API. Checks for Registration of third party 7Cs API then do the other job.
But When I install this application in other machine this dll as well as application (Both StandAlone as well as ASP.Net) after registering the 7Cs Library and their data. The standalone application runs fine and do its work but through ASP.Net Web Application it hangs on the first API which checks the library has valid registration. It did not return from the function. The same thing runs fine from my development machine with both type of application. But fails in other machine with Web Application.
I thought it was permission problem under ASP.Net execution I have given all permission but still the problem persists.
Can any body give me any tips as I know you all people are very intelligent in your respective field.
Regards
Anuj Mishra
Software Engineer
|
|
|
|
|
Is there a way to find out more about the cause of the failure?
It used to work but not anymore.
It did that to me on two different computers.
The file other.dll doesn't get copied to C:\WINNT\system,
so myX.dll cannot be registered (since it depends on it).
See CAB, INF file and error log below...
Thanks!
-----------------
CAB FILE CREATION
-----------------
CabArc.exe n myX.cab other.dll myX.dll myX.inf
--------
INF file
--------
[Version]
; This section is required for compatibility on both Windows 95 and Windows NT.
Signature="$CHICAGO$"
AdvancedInf=2.0
[Add.Code]
other.dll=other.dll
myX.dll=myX.dll
[other.dll]
file-win32-x86=thiscab
FileVersion=1,0,0,1
DestDir=10
RegisterServer=no
[myX.dll]
file-win32-x86=thiscab
clsid={98B6686C-EF56-4FFF-ACBD-2BC5A853377D}
FileVersion=1,0,0,1
RegisterServer=yes
------------
IE Error log
------------
*** Code Download Log entry (02 Mar 2005 @ 14:34:52) ***
Code Download Error: (hr = 8007007e) The specified module could not be found.
Operation failed. Detailed Information:
CodeBase: file:///C:/Dev/myX/myX.cab
CLSID: {98B6686C-EF56-4FFF-ACBD-2BC5A853377D}
Extension:
Type:
LOG: Item other.dll being processed.
--- Detailed Error Log Follows ---
LOG: Download OnStopBinding called (hrStatus = 0 / hrResponseHdr = 0).
LOG: Item other.dll being processed.
LOG: Item myX.dll being processed.
LOG: URL Download Complete: hrStatus , hrOSB:1, hrResponseHdr , URL:(file://C:\Dev\myX\myX.cab)
LOG: File C:\WINNT\Downloaded Program Files\myX.dll being registered.
ERR: Setup Failed Error Code: (hr) = 8007007e, installing: myX.dll to (null) destination code(0)
LOG: Reporting Code Download Completion: (hr:8007007e (FAILED), CLASSID: 98b6686c..., szCODE:(file:///C:/Dev/myX/myX.cab), MainType:(null), MainExt:(null))
|
|
|
|
|
I'm being driven slowly mad trying to figure out how to make this function work!
I have a word document that I have in memory, and place this in an IStream derived class.
When I try to BindIFilterFromStream, the Stat method in my class is called, then BindIFilterFromStream returns E_FAIL. It doesn't seem to even inspect the data held in the stream.
Are there some special values I need to set during Stat?
Does this function even actually work?
|
|
|
|
|
i m building COM components in VC++ using ATL lib.
I want to dyanamically create listboxes on my dialog.
I hav tried using classes in "atlcontrols.h" but dont know which Window handle to pass to get the list box on dialog.
Same with Static text boxex n edit boxes.
Can u plz try n give me some soln .
Gaurav Jain
K.K. Wagh Institue of Engineering Education and Research,
Nashik,
Maharashtra,
India.
gauravjain911@yahoo.com
|
|
|
|
|
I have written a c# utility that monitors the status of a running application. The running application (lets call it ABC.EXE) exposes a com interface and I can obtain information such as the active customer number etc.
The first problem I had was that if I attempted to create a new ABC object it would automatically execute the ABC.EXE if it wasn’t already running. I managed to fix this by checking for the presence of the window (findwindow) beforehand.
However, the user may have more than one instance of ABC.EXE running, and I only want to communication with a specified one.
I’m a bit stuck on this. Any help appreciated.
|
|
|
|
|
Dear friends,
I have created a project in VB having MSFlexgrid. I have to fill records to that grid by VC code(ATL component). So how I get the reference of that grid in VC. Please help me.
|
|
|
|
|
Hello I am new to COM,OLE,AUTOMATION,ActiveX in Vc
so please provide me the difference among each there as well as their purpose
Thanks
Fahad Bilal
|
|
|
|
|
hi!!
im trying to create a Schema rowset as i want to display the tables existing in the database.
but im geting a Windows Error Report as soon as i execute getrowset function. Im building a COM using ATL.
any help is welcome.
STDMETHODIMP Cfuctcont::pop()
{
// TODO: Add your implementation code here
DBPROP InitProperties[5], InitProperty[3];
DBPROPSET rgInitPropSet;
IDataInitialize * pDataInit = NULL;
IDBInitialize * pDataSourceIDBInitialize = NULL;
IDBCreateSession * pSession = NULL;
IDBProperties * pProperties = NULL;
IDBCreateCommand * pCreateCommand = NULL;
ICommand * pCommand = NULL;
ICommandProperties * pCommandProperties = NULL;
ICommandText * pCommandText = NULL;
IOpenRowset * pOpenRowset = NULL;
IRowset * pRowset = NULL;
IRowsetChange * pRowsetChange = NULL;
IDBSchemaRowset * pSchemaRowset =NULL;
WCHAR wszProvider[] = L"MSDASQL"; // The Provider string
CLSID clsid;
HRESULT hr= S_OK;
// Init OLE and set up the data
CoInitialize(NULL);
// Setting up all the properties
// a) Setting up the Intitialization properties
for(long i=0;i<5; i++)
{
InitProperties[i].dwOptions = DBPROPOPTIONS_REQUIRED;
InitProperties[i].colid = DB_NULLID;
InitProperties[i].dwStatus = DBPROPSTATUS_OK;
}
// Data source string.
InitProperties[1].dwPropertyID = DBPROP_INIT_DATASOURCE;
InitProperties[1].colid = DB_NULLID;
InitProperties[1].vValue.vt = VT_BSTR;
InitProperties[1].vValue.bstrVal = SysAllocString(L"user");
InitProperties[4].dwPropertyID = DBPROP_INIT_OLEDBSERVICES;
InitProperties[4].vValue.vt = VT_I4;
InitProperties[4].vValue.lVal = DBPROPVAL_OS_ENABLEALL;
rgInitPropSet.guidPropertySet = DBPROPSET_DBINIT; // the property set
rgInitPropSet.cProperties = 5; // # of properties being set
rgInitPropSet.rgProperties = InitProperties; // array of DBPROP structures
// b) The Rowset properties
InitProperty[0].dwPropertyID = DBPROP_CANFETCHBACKWARDS;
InitProperty[1].dwPropertyID = DBPROP_IRowsetLocate;
for(i=0;i<2; i++)
{
InitProperty[i].dwOptions = DBPROPOPTIONS_REQUIRED;
InitProperty[i].colid = DB_NULLID;
InitProperty[i].dwStatus = DBPROPSTATUS_OK;
}
// 1. Data Source Initialization
hr = CoCreateInstance(CLSID_MSDAINITIALIZE, NULL, CLSCTX_INPROC_SERVER, IID_IDataInitialize, (void**)&pDataInit);
// Creating the IDBInitialize
hr = CLSIDFromProgID(wszProvider, &clsid);
hr = pDataInit->CreateDBInstance(clsid, NULL, CLSCTX_INPROC_SERVER, NULL, IID_IDBInitialize, (IUnknown**) &pDataSourceIDBInitialize);
// Setting the Initialization properties
hr = pDataSourceIDBInitialize->QueryInterface(IID_IDBProperties, (void**)&pProperties);
hr = pProperties->SetProperties(1,&rgInitPropSet);
hr = pDataSourceIDBInitialize->Initialize( );
hr = pDataInit->Release();
hr = pProperties->Release();
//session creation
hr = pDataSourceIDBInitialize->QueryInterface(IID_IDBCreateSession, (void**)&pSession);
hr = pDataSourceIDBInitialize->Release();
IUnknown *pUnkSession =NULL;
hr = pSession->CreateSession(NULL, IID_IOpenRowset, &pUnkSession);
IDBSchemaRowset * pIDBSchemaRowset = NULL;
// pUnkSession->QueryInterface(IID_IDBSchemaRowset, (void**)&pIDBSchemaRowset);
pSession->Release();
IUnknown * pUnkCommand = NULL;
IOpenRowset * pIOpenRowset = NULL;
WCHAR wszTableName[11] = {0};
DBID TableID;
IUnknown *ppUnkRowset;
IUnknown *ppRowset;
VARIANT rest[]={VT_EMPTY,VT_EMPTY,VT_EMPTY,VT_EMPTY};
::MessageBox(NULL,"Helooo",NULL,MB_OK);
const ULONG cProperties = 2;
DBPROP rgProperties[cProperties];
DBPROPSET rgPropSets[1];
// rgPropSets, cProperties, rgProperties);
//DBPROPSET* pPropSet, ULONG cProperties, DBPROP* rgProperties)
rgPropSets->rgProperties = rgProperties;
rgPropSets->cProperties = cProperties;
rgPropSets->guidPropertySet = DBPROPSET_ROWSET;
rgProperties[0].dwPropertyID = DBPROP_CANFETCHBACKWARDS;
rgProperties[1].dwPropertyID = DBPROP_IRowsetLocate;
for(i=0;i<2; i++)
{
rgProperties[i].dwOptions = DBPROPOPTIONS_REQUIRED;
rgProperties[i].colid = DB_NULLID;
rgProperties[i].dwStatus = DBPROPSTATUS_OK;
}
hr = pSchemaRowset->GetRowset (
NULL,
DBSCHEMA_TABLES,
0,
NULL,
IID_IRowset,
1,
rgPropSets,
&ppRowset);
if(hr==S_OK)
::MessageBox(NULL,"ok",NULL,MB_OK);
if(hr==DB_S_ERRORSOCCURRED )
::MessageBox(NULL,"HI",NULL,MB_OK);
if(hr==DB_S_ASYNCHRONOUS)
::MessageBox(NULL,"HI1",NULL,MB_OK);
//if(hr==DB_S_NOTSINGLETON )
//::MessageBox(NULL,"HI2",NULL,MB_OK);
if(hr==E_FAIL )
::MessageBox(NULL,"HI3",NULL,MB_OK);
if(hr==E_INVALIDARG )
::MessageBox(NULL,"HI4",NULL,MB_OK);
if(hr==E_NOINTERFACE )
::MessageBox(NULL,"HI5",NULL,MB_OK);
if(hr==DB_E_ABORTLIMITREACHED)
::MessageBox(NULL,"HI6",NULL,MB_OK);
if(hr==DB_E_ERRORSOCCURRED)
::MessageBox(NULL,"HI7",NULL,MB_OK);
if(hr==DB_E_NOAGGREGATION)
::MessageBox(NULL,"HI8",NULL,MB_OK);
if(hr==DB_E_NOTFOUND )
::MessageBox(NULL,"HI9",NULL,MB_OK);
if(hr==DB_E_NOTSUPPORTED)
::MessageBox(NULL,"HI10",NULL,MB_OK);
if(hr==DB_SEC_E_PERMISSIONDENIED)
::MessageBox(NULL,"HI11",NULL,MB_OK);
if(hr==DB_E_OBJECTOPEN )
::MessageBox(NULL,"HI12",NULL,MB_OK);
if(hr==E_OUTOFMEMORY )
::MessageBox(NULL,"HI13",NULL,MB_OK);
::MessageBox(NULL,"HIsfsf",NULL,MB_OK);
return S_OK;
}
thanking you.
Gaurav Jain
K.K. Wagh Institue of Engineering Education and Research,
Nashik,
Maharashtra,
India.
gauravjain911@yahoo.com
|
|
|
|
|
could you please help me in finding fft scale factor in Magnetic resonance Dicom images fromo the header information.
|
|
|
|
|
Greetings,
A dicom Server project contains several complete iods. I believe one is the mri iod.
|
|
|
|
|
How do i implement COM/activex objects in c++?
for example i want to use wscript.shell obj?
|
|
|
|
|
If you really need to program COM in raw C++ then get ready you have to read a lot as it is possible to create in raw C++ but it requires lot of efforts. You have to implement from Class factory to QueryInterface to Addref, Release on your own.
I you choose to implement COM through ATL then Most of your work are already done and you only have to concentrate on main programming logic.
Refer Book on COM Programming from DON BOX if you really need to implement COM in C++.
Anuj Mishra
Software Engineer
|
|
|
|
|
i am not having any idea about mfc & vc++
can anyone help me to clear concepts of mfc , window programing, vc++.
and also suggest some books to read as beginer
|
|
|
|
|
use Programming Windows in VC++ by Charles Petzold
|
|
|
|
|
|
I just want to know when we allocate a BSTR using SysAllocString(), where does COM allocate its memory? In process's own heap? some shared memory or where?
BSTR is just a wchar_t with size of string added in its start, if i create my own string in this format and pass it to any COM function, will that work?
+
LPWSTR allocated with CoTaskMemAlloc() doesnot have size in its start, how does COM decide whether to check size from start of string or check for null terminating string??
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
|
1. wild guess - on the heap of the library that exported the SysAllocString ?
2. I think yes, as long as you will be the one who releases the memory back
3. when expects BSTR , it expects the size on the start, when parameter is LPWSTR , it checks for zero termination.
|
|
|
|
|
I believe it's allocated on the COM heap.
M.Shoaib Khan wrote:
LPWSTR allocated with CoTaskMemAlloc() doesnot have size in its start, how does COM decide whether to check size from start of string or check for null terminating string??
When COM allocates a BSTR, it does something like this:
struct _BSTR {
int length;
OLECHAR str[1];
};
BSTR SysAllocString(LPCOLESTR src)
{
int bstr_len = wcslen(src) + 1;
_BSTR* bstr = CoTaskMemAlloc(bstr_len * sizeof(OLECHAR) + sizeof(int));
bstr->length = bstr_len;
wcscpy(bstr->str, src, bstr_len - 1);
return bstr->str;
} As you can see, a BSTR really isn't a LPWSTR. It just appears to be.
--
My name in Katakana is ヨルゲン.
My name in German is Jörgen.
My name in Mandarin/Kanji is 乔尔根 西格瓦德森.
I blog too now[^]
|
|
|
|
|
i wrote a com dll in vc6,and wanna ref it in vc.net,but failed.
another way,i try to import it into my test client app using "#import",then
failed too,with the compiler error:"fatal error C1083: Cannot open type library file:'D:MyFirstSrvDll\Debug\MyFirstSrvDll.dll'"
|
|
|
|
|
|
WMI Blues
I am trying to set the NIC properties on a local machine using WMI. The code to do this is written in C++. I have a windows service and the code to set the NIC settings is handled in that service.
Problem:
I can get two of the properties always (does not matter which one like ip, default gateway or DNS) to set. However, on the third attempt to set any property, the connectServer () function fails (connect server function is required to get the namespace). I tried another experiment, when I restart my service after setting a property it will always work. The CoInitializeSecurity settings are exactly the same as the one in my MFC app. I am clueless at this point and I have a hunch that the code to set NIC settings residing in a service has got something to do with my program not running properly.
Note: I created a test MFC application that uses all my above functions and it works well all the time.
Any help will be appreciated
Thanks
newbee78
|
|
|
|
|
i want to learn COM written in C#, where should i begin
Could you please show me some books that teach me how to program COM with C#
Thank you so much
|
|
|
|
|
C# is not a COM programming language. Do you mean you need to support legacy COM objects in C#? If so, usually the platform will create a wrapper for you without much need to dig into the details of interoperability.
You can interface C# to COM objects, you can call the COM libraries from C# by declaring the appropriate dll imports, you can create NET assemblies that are compatible with COM objects, but C# is not intended to program COM directly.
If you want to actually create COM objects you really should be working in C++. "Beginning ATL 3 COM" by Richard Grimes et al. is a good place to start, if you can find a copy. It was published by Wrox Press who is no longer in business. Some titles have been republished by APress, this is not one of them, but you can probably still find copies of the Wrox version online.
|
|
|
|
|
Actually you can write COM in C#. It is a horrible implementation technology for COM. I have done this using a C# server and a C++ client.
In C# you declare an interface like this:
[Guid( "ert565645-EA16-4a8c-8CDD-434564565675" ),
InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface _<MyObjectName>
{
string InterfaceMethod1;
InterfaceMethod2
}
Your class then extends that interface:
[Guid( "3D655F63-118B-4e28-B1D5-30DD4AE77424" )]
public class <MyObjectName> : _<MyObjectName>
{
public string Method1()
{
return "Silly";
}
string InterfaceMethod1()
{
return Method1();
}
Stuff like that can work. It is difficult to work with and best advised to stay away from. When you return an object from a call in an interface you will run into problems that the interface does not know about the object and therefore making calls on that object becomes problematic. To deal with this problem you will have to add an attribute to the declaration of your Class. This Attribute [System.Runtime.InteropServices.ComVisible(true)] is added to the declaration of your class.
Please note that doing this flys in the face of everything that COM interactions stand for, but it does work. Also you will have to generate a hack header file to handle certain types used when the typelibrary is imported into your C++ code.
Regards
Ward
Frag
Try, Fail..Fail, Succeed
Tool Developer
Michigan, USA
|
|
|
|
|
Is it possible to save a Word Document to a stream using automation?
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|