|
rwestgraham wrote:
If you spend as much time with women as I spend masturbating, I envy you.
release and go query some woman's interface. Beats addrefing yourself. Just finding the right interface is fun as it is!
Good music: In my rosary[^]
|
|
|
|
|
Actually, I have a live in. But these days I'm more interested in querying some IUnknowns, LOL. Just gotta make sure you use MarshalByLatex before you insert your stub into some strange proxy. :->
|
|
|
|
|
Hi!
I´m reading a Excel-Sheet by calling the Excel-COM-Object with the following code:
Excel.Application ExcelObj = new Excel.Application();
Excel.Workbook theWorkbook = ExcelObj.Workbooks.Open(filename, false, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, true, true);
Excel.Sheets sheets = theWorkbook.Worksheets;
Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(sheetNumber);
for (int i = startRow; i <= endRow; i++)
{
Excel.Range range = worksheet.get_Range(startCol + i.ToString(), endCol + i.ToString());
System.Array myvalues = (System.Array)range.Cells.Value2;
string[] strArray = ConvertToStringArray(myvalues);
storage.Add(strArray);
}
ExcelObj.Quit();
My problem is, that Excel does not really quit but stay in my task-manager.
What do i have to do to make Excel to leave my memory?
Thanks!
|
|
|
|
|
Hello:
I am developping my first COM project , that in fact is an attempt to split a previous project into a client and a COM server. Since I'm not very experienced in this field, I'm having linking errors when trying to compile the server:
winComServer.cpp
Linking...
winComServer_i.obj : error LNK2005: _CLSID_CoServer already defined in winComServer.obj
winComServer_i.obj : error LNK2005: _LIBID_WINCOMSERVERLib already defined in winComServer.obj
winComServer_i.obj : error LNK2005: _IID_ICoServer already defined in winComServer.obj
I have been reading several forums about this kind of problems with no possitive results.
I'm NOT including "initguid.h" from "stdafx.h", that seems to be a source of problems.
Any help would be really welcomed.
Jose M
-- modified at 9:13 Monday 12th September, 2005
|
|
|
|
|
I have solved the problem:
I had changed my precompiled headers settings. I must use them in order to make the app works.
Sorry guys, no winners this time. Next time you shoud be faster .
Jose M
|
|
|
|
|
Hi,
I have tried to show an ActiveX Control on a Window in SDI application. I used the following API,
CLSID clsid; //clsid of activex control
IUnknown* pIunknown;
HRESULT hResult;
hResult = CoCreateInstance( clsid, NULL,
CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
IID_IUnknown, (void**)&pIunknown );
But still the Control is not display.......
Where lies the Error? Can anyone help me out?
-- modified at 5:31 Monday 12th September, 2005
|
|
|
|
|
Friends,
I want to develop a ActiveX control container,and save data in flat(uncompound) document.
My document CxxDoc is derived from COleDocument,and the constructor as following:
CxxDoc::CxxDoc()
{
// EnableCompoundFile();
// ^^^^^^^^^^^^^^^^^^^^^^^^^^I need a flat (uncompound) file.so i delete it.
...
}
Firstly, Is it OK????Can i save data in flat document?
Secondly,my client item is CxxClientItem,
class CxxClientItem : public COleClientItem
The WriteItem and ReadItem function (copied from the sample program of ActiceX control test container in Visual C++) as follows. They can work correctly in compound document. Please tell me how to change them from compound document to flat(uncompound) document. I'm a new and I do need your help.
void CxxClientItem::WriteItem( CArchive& ar )
{
USES_CONVERSION;
IStoragePtr pStorage;
IStreamPtr pStream;
IPersistStreamInitPtr pPSI;
TCHAR szItemName[64];
HRESULT hResult;
IPersistStoragePtr pPersistStorage;
CxxDoc* pDoc;
CLSID clsid;
(void)ar;
pDoc = GetDocument();
ASSERT_VALID( pDoc );
ASSERT( pDoc->m_lpRootStg != NULL );
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^It is wrong in uncompound document
ASSERT( pDoc->m_bCompoundFile );
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^It is wrong in uncompound document
ASSERT( m_lpStorage != NULL );
ASSERT( !ar.m_bForceFlat );
GetItemName( szItemName );
if( !pDoc->m_bSameAsLoad )
{
hResult = pDoc->m_lpRootStg->CreateStorage( T2COLE( szItemName ),STGM_CREATE|STGM_READWRITE|STGM_TRANSACTED|STGM_SHARE_EXCLUSIVE, 0, 0, &pStorage );
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^It is wrong in uncompound document
if( FAILED( hResult ) )
{
AfxThrowOleException( hResult );
}
m_lpNewStorage = pStorage;
m_lpNewStorage->AddRef();
m_bNeedCommit = TRUE;
}
else
{
pStorage = m_lpStorage;
}
......
}
void CxxClientItem::ReadItem( CArchive& ar )
{
USES_CONVERSION;
BOOL tUsedStream;
IStoragePtr pStorage;
IPersistStreamInitPtr pPSI;
IStreamPtr pStream;
TCHAR szItemName[64];
HRESULT hResult;
BOOL tQuickActivated;
IPersistStoragePtr pPersistStorage;
CLSID clsid;
(void)ar;
CxxDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
ASSERT(pDoc->m_lpRootStg != NULL);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^It is wrong in uncompound document
ASSERT(pDoc->m_bCompoundFile);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^It is wrong in uncompound document
ASSERT(m_lpStorage == NULL);
ASSERT(m_lpLockBytes == NULL);
ASSERT( !ar.m_bForceFlat );
// get item name
GetItemName( szItemName );
// open storage for this item
hResult = pDoc->m_lpRootStg->OpenStorage( T2COLE( szItemName ), NULL,
STGM_READWRITE|STGM_TRANSACTED|STGM_SHARE_EXCLUSIVE, 0, 0, &pStorage );
// ^^^^^^^^^^^^^^^^^^^^^^^^^^It is wrong in uncompound document
if( hResult != S_OK )
{
TRACE1( "Warning: unable to open child storage %s.\n", szItemName );
// upon failure throw file exception (item will be cleaned up)
AfxThrowOleException( hResult );
}
ASSERT(pStorage != NULL);
// remember the storage
m_lpStorage = pStorage;
ASSERT(m_lpStorage != NULL);
m_lpStorage->AddRef();
......
}
|
|
|
|
|
Can someone please tell me more or less how Microsoft updates your OS over the internet? I know they call API's through ActiveX but how do they do it?
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
When I am into the STA or MTA threads, how can I check at runtime whether I am STA or MTA thread..
|
|
|
|
|
i'm wonder whether CComPtr<ixxxx> is equal with IXXXPtr(raw interface wrapper class)?
for example:
Excel::_ApplicationPtr spApp;
HRESULT hr = spApp.CreateInstance(L"Excel.Application"); // this will succeed
//CComPtr<Excel::_Application> spApp;
//HRESULT hr = spApp.CoCreateInstance(L"Excel.Application"); //this will fail
i guess in most cases this should be equal ,right?
-- modified at 2:24 Thursday 8th September, 2005
|
|
|
|
|
Hi,
I have stumbled upon an issue which I am failing to resolve..
Basically I have an outproc COM server (.exe) which exposes a couple of interfaces which are
bridged to inproc COM objects, .dll's). One of the inproc objects is interfacing with a serial port, this works like a charm with my test application (not using the outproc COM server directly, but instead using the inproc COM objects) but when using the outproc COM server (.exe) as the call-gateway
I am unable to open up the serial ports...
The problem is to open the serial port(s)...
Everything runs on the local machine, administrator accounts, WinXP SP2..
Very "fuzzy" description, however..
|
Application | .exe COM Server - inProc objects <-> serial port
| (not a service)
No impersonation code has been done, everything is most plain (i.e. no tricks applied)
Any ideas ?
// Fredrik
|
|
|
|
|
Hi,
I am using a third party COM component to connect to a remote SSH server. For this I have created a STA thread. Now I have a trivial user scenario, when the user issues a connect command a modal dialog is shown with a cancel button to display the status of connection. At anytime the user can press cancel button to abort the operation. Since the calls to cancel/abort are generally asynchronous the actual call to disconnect comes from a different STA thread. Now the problem I am facing is that the after the user clicks the cancel button the dialog is not getting disposed away and the thread is not stopping, thus my application hangs. If I attach a debugger to the release build of the application, the application breaks in the debugger with Invalid RtlHeapAddress. Initially I though it could be a problem of directly accessing my interface pointer, so I marshalled the interface pointer using GlobalInterfaceTable, yet the result is the same.
After some debugging I found that the call to Connect is not returning at all, to be on a safer side I have a message loops in my all STA threads.
How do I make sure that my dialog is disposed properly and my STA thread also stops properly.
I am using VC++ 6.0 for developing my application. The COM part is implemented using pure C++
Thanks
|
|
|
|
|
I want to write a service which will notify if any new file is generated in particular directory. How can i trap this event in Atl service
|
|
|
|
|
|
Hey,
I'm using late binding for Excel and I have problem with calling Open (Workbooks) method.
Some other method (properties) work just fine (I'm using Office XP).
Code:
<br />
objWorkbooks = excel.GetType().InvokeMember("Workbooks",BindingFlags.GetProperty, null, excel, null);<br />
<br />
object[] oParam= new object[13];
oParam[0] = FileName;<br />
for(int t=1; t < parameters.Length; t++)<br />
oParam[t] = Type.Missing;
<br />
objWorkbooks.GetType().InvokeMember("Open",BindingFlags.InvokeMethod, null, objWorkbooks, oParam);<br />
<br />
And exception is: "Additional information: Exception has been thrown by the target of an invocation."
Tnx for helping me.
Nice day,
David
|
|
|
|
|
plz tell me how to access a dll on a server from a client side VB application
I am able to access ASP service from vb app. through SOAP
but how to do this with .dll
plz help
Thanks in advance
|
|
|
|
|
I want to specify a sound card for windows media player but keep the windows default sound card unchanged (i.e., windows use another sound card). By the use of DirectSound, I can enumerate all sound cards in my system.
So, after I obtained the GUID of the sound cards, how can I specify a GUID for the windows media player? Also, how can i specify another GUID for the system as its default sound card?
Thanks for your kindness help!!!
-- modified at 5:09 Tuesday 30th August, 2005
|
|
|
|
|
Trying to get a VB app to run Windows Media Services on a remote machine.
This code
tServerType = Type.GetTypeFromProgID("WMSServer.Server", <myserver>, True)
generates this error
System.Runtime.InteropServices.COMException (0x800401F3): Invalid class string
at System.RuntimeType.GetTypeFromProgIDImpl(String progID, String server, Boolean throwOnError)
at System.Type.GetTypeFromProgID(String progID, String server, Boolean throwOnError)
I really need help with how to configure my local and my remote machine to talk to each other.
HELP!!
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
"WMSServer.Server" is an invalid ProgID. Have you registered the component/proxy locally? (I have no idea how Windows Media Services work, but you mention "remote machine", so I assume you're using DCOM. Then you need to either have the components or the proxy registered on your client machine)
Good music: In my rosary[^]
|
|
|
|
|
I'm pretty green with this stuff.
I am using DCOM, yes.
I am developing on the client machine right now, so I would expect that, yes, they are registered.
"WMSServer.Server" is an invalid ProgID. Should it be the GUID?
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
DaveC426913 wrote:
"WMSServer.Server" is an invalid ProgID. Should it be the GUID?
Nah. ProgIDs and CLSIDs (Class ID which is a GUID), are mostly interchangeable. GUIDs are unique, but ProgIDs aren't [edit]necessarily, but are most of the time. (I have yet to encounter two identical ProgIDs for different components!)[/edit]
What the error says is that the component isn't registered on your computer. Not as implementation nor as proxy. You need to investigate further on that.
-- modified at 1:53 Tuesday 30th August, 2005
|
|
|
|
|
"What the error says is that the component isn't registered on your computer. Not as implementation nor as proxy. You need to investigate further on that."
Would that be on the server wherer the service is, or on the client where the app is running?
It's got to be registered somehow - it is already in use when I started developing on these boxes.
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
Hi,
I want to know whether there is any API to show Bitmaps of Registered ActiveX Controls in a ToolBox. If not , any idea on how to go about...
|
|
|
|
|
Last time I checked, I could not find one. I used the registry to extract that information.
Good music: In my rosary[^]
|
|
|
|
|
can you just code it in brief on how to show bitmaps from registry.
This is useful to me since i have no idea on how to do it.
|
|
|
|
|