|
I'll give you a word or two of advice - you've posted this in the Delphi forum and again here - you'll get better help/assistance if you dont cross-post - pick a forum, stick with it - people will get narky if you post in more than one forum - if you get the forum wrong, people will guide you to the correct one
'g'
|
|
|
|
|
To some extent I can understand in this case. Help may come from either forum but most people who visit one probably won't visit the other.
Steve
|
|
|
|
|
How can i get Visual Studio to regenerate wrapper classes for an activex control? The control has updated but removing it from my project and adding it back does not generate the wrapper classes.
|
|
|
|
|
Remove existing wrapper class from your project and add new one either by adding a member variable for your control or by 'Add MFC class from ActiveX control' wizard.
|
|
|
|
|
Since removing and adding does not work for you, you could add the activex control into a new project and then take the generated files from there and replace your original files with the new ones.
|
|
|
|
|
Sounds like a reasonable suggestion.
Steve
|
|
|
|
|
Thanks for the suggestion. Do you guys have any idea why removing does not work? Do you know where visual studio keeps this info?
Thanks,
Eugen
|
|
|
|
|
I've ran into the same problem in the past. One of my co-workers told my a magic incantation that got the wrappers regenerated, but I can't remember what it was.
Steve
|
|
|
|
|
Hi,
I have a com local server(an BitManipulater.exe server) and a client.I executed two instances of client programs in debug mode.If i open the task manager in windows xp, the processes tab is showing only one BitManipulater.exe process.How com deals with local server, if lot of client are using same local server.I thought there will be two instances of BitManipulater.exe.Any explanation on this please,
Thanks in advance
venkatanarayana
|
|
|
|
|
When calling CoRegisterClassObject[^] for your class object use the REGCLS_SINGLEUSE flag (see here[^]). This should result in a separate exe per instance.
Steve
|
|
|
|
|
Hi Steve,
Thanks for the info.I am using MFC for creating com server.How i can access CoRegisterClassObject,I think object factories registration is done in COleObjectFactory::RegisterAll
Thanks & Regards,
venkatanarayana
|
|
|
|
|
It's not hard to find out. I placed a breakpoint in CoRegisterClassObject and when it was hit had a look at the stack. The MFC function COleObjectFactory::Register seems to be where the action takes place. The code in question looks like this:
SCODE sc = ::CoRegisterClassObject(m_clsid, &m_xClassFactory,
CLSCTX_LOCAL_SERVER,
m_bMultiInstance ? REGCLS_SINGLEUSE : REGCLS_MULTIPLEUSE,
&m_dwRegister);
Note the that the m_bMultiInstance member seems to be exactly what you're looking for. When I searched MFC's source for it I found this:
void COleTemplateServer::ConnectTemplate(
REFCLSID clsid, CDocTemplate* pDocTemplate, BOOL bMultiInstance)
Which contains the following:
m_bMultiInstance = bMultiInstance;
This functions seems to be called from your application's InitInstance function:
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MFCEXETYPE,
RUNTIME_CLASS(CMFCExeComServerDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CMFCExeComServerView));
AddDocTemplate(pDocTemplate);
m_server.ConnectTemplate(clsid, pDocTemplate, FALSE);
Change the underlined bit to TRUE are see how things go. Don't be scared to look at the source code for MFC (or whatever libraries you're using)!
Steve
|
|
|
|
|
I want to know general question for using com and dcom ...
Is there any article that talks about com and dcom for beginners using c#
i am search in google but not find any simple article , plz help me ?
|
|
|
|
|
Hi
I have successfully got Directshow outputing a video from C++ MFC using Sample Grabber, but I can not figure out how to play the audio with this.
I have attached code snippet of what I have done currently, can anyone tell me what I need to do to get audio stream to work. I have added the sound renderer filter, just dont know how to connect it with the rest of the graph.
Thanks
HRESULT hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&pGraph);
hr = pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl);
hr = pGraph->QueryInterface(IID_IMediaEventEx, (void **)&pEvent);
hr = pGraph->QueryInterface(IID_IBasicAudio, reinterpret_cast<void**>(&m_pAudio));
hr = pGraph->QueryInterface(IID_IMediaSeeking, reinterpret_cast<void**>(&pSeeking));
hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&pGrabberF);
if (FAILED(hr))
{
// Return an error.
}
hr = pGraph->AddFilter(pGrabberF, L"Sample Grabber");
CoCreateInstance(CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pSoundRenderer);
hr = pGraph->AddFilter(g_pSoundRenderer, NULL);
// hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&pGrabberF);
// hr = pGraph->AddFilter(
if (FAILED(hr) )
{
// Return an error.
}
pGrabberF->QueryInterface(IID_ISampleGrabber, (void**)&pGrabber);
//ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
mt.majortype = MEDIATYPE_Stream;
//mt.subtype = GUID_NULL;//MEDIASUBTYPE_RGB24;
hr = pGrabber->SetMediaType(&mt);
hr = pGraph->AddSourceFilter(fileName.AllocSysString(), L"Source", &pSrc);
if (FAILED(hr))
{
// Return an error code.
}
hr = ConnectFilters(pGraph, pSrc, pGrabberF);
// Create the NULL renderer and connect
hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, reinterpret_cast<void**>(&m_pNullRenderer));
hr = pGraph->AddFilter(m_pNullRenderer, L"NullRenderer");
hr = ConnectFilters(pGraph, pGrabberF, m_pNullRenderer);
|
|
|
|
|
Can someone help me with this error? I am compiling an IDL file and am getting an MIDL2020 error. This error is defined as
"General access denied error". I am working on a Windows Vista machine and have searched for a solution but cannot find anything that solves this. Any suggestions would be greatly appreciated. Below is the complete compilation error:
midl\oleaut32.dll : error MIDL2020 : error generating type library : SaveAllChanges Failed : .\spellcheck.tlb (0x80070005)
Here is the program:
//Creating the interface
import "unknwn.idl";
[object,uuid(C73BA5B4-B466-4348-8CC2-E6B48998B3F7)]
//Defining the interface
interface ISpellChecker : IUnknown
{
HRESULT CheckSpelling([in,string] char *word,[out,retval] BOOL *isCorrect);
HRESULT UseCustomDictionary([in,string] char *filename);
}
//Define type library
[uuid(C81C9C52-008B-429d-8533-262E90A1D0D5)]
library SpellcheckerLib
{
[uuid(57B7A8A0-E4D7-11d0-818D-444553540000)]
coclass CSpellChecker
{
interface ISpellChecker;
}
};
modified on Sunday, May 30, 2010 10:46 AM
|
|
|
|
|
I obtained the answer for this on another board. Basically, the problem is that I did not sign-on as administrator on my Visual Studio program.
|
|
|
|
|
Something puzzling is happening and I don't understand why. I tested using both my C# and VB.NET test apps and both result in the same behavior. When I run the application I have the following line (C#):
m_COMApp = new SignalServer.Application();
No matter what I do, I always get a new instance of the COM server, even if the server is already up and running. This does not happen in XP and I don't recall it ever happening under Vista (I plan to re-test that this weekend as I have Vista at home). This only happens when I run the COM client directly from within Visual Studio. I even changed my reference to point to another version of the server, and it still wanted to load the server found in the original directory.
I decided to run the application by double-clicking in Explorer and then I get the expected behavior. That is, if a server is already running, it will simply attach to the currently running server. Anyone know why I get the other behavior? Some thoughts are:
1) I am on Visual Studio 2005. Maybe this won't happen in 2010.
2) All the applications are 32-bit apps and the OS is 64-bit. Maybe because of the x86 directory names, things get a little messed up?
Anyone else experience this? Thanks for any information.
|
|
|
|
|
Are you running Visual Studio with UAC elevation?
Best Wishes,
-David Delaune
|
|
|
|
|
Aha! Thanks. That was the problem. I turned off UAC and everything works just as I would expect (like on XP)! I always leave UAC turned on because it's great for finding issues our customers will run into. I didn't even think about turning it off this time around.
|
|
|
|
|
Hi,
I am working on Excel Automation.
Implemented the logic to retrieve all the running Excel instances, now I am getting IDispatch pointer. Assigning this IDispatch Pointer to Excel object.
Following is the code:
IDispatch* p=NULL;
HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, __uuidof(IDispatch), (void**)&p);
if(hr == S_OK)
{
try
{
Excel::WindowsPtr pWindow = NULL;
HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow);
Excel::_ApplicationPtr xl;
xl = pWindow->Application;
But getting com exception at above line. The com error: _Vfpointer: scalar deleting destructor(unsigned int) m_hresult:"Member not found".
I googled but there is no clarity in solution.
If any clue, please let me know.
Thanks in Advance.
Regards,
KTTransfer.
|
|
|
|
|
KTTransfer wrote: Excel::WindowsPtr pWindow = NULL;
HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow);
What's the deal with this? You'd hope Excel::WindowsPtr wraps an IDispatch pointer (does it?).
Try this:
Excel::WindowsPtr pWindow = NULL;
HRESULT hr = p->QueryInterface(&pWindow);
Steve
|
|
|
|
|
I tried this,in this case I am getting "hresult hr" as "E_NOINTERFACE".
|
|
|
|
|
I'd take it at its word.
Steve
|
|
|
|
|
Hi,
I created windows application which reads the text file and loads into datagridview on clicking Open button. I would like to use this windows app in Internet Explorer browser. I created the below html and tried to access in IE. The design was shown perfectly and I clicked on Open button and selected text file in File Dialog box and I got the below exception. I found several posts regarding this issue in google. But those didn't solved the problem. Please guide me to resolve this issue. Thanks in advance..
Exception: "application attempted to perform an operation not allowed by the security policy. To grant this application the required permission, contact your system admistrator or use the Microsoft .NET Framework Configuration tool."
<html>
<body color=white>
<hr>
<font face=arial size=1>
<OBJECT id="myControl1" name="myControl1" classid="ActiveXDotNet.dll#ActiveXDotNet.myControl" width=800 height=450>
</OBJECT>
</font>
<hr>
</body>
</html>
ActiveXDotNet.dll is the application dll
ActiveXDotNet is the namespace
myControl is the class name
|
|
|
|
|
Hi,
I have an outproc server Executable which exposes an
Interface IServicer.
IServicer has a Method GetBytArray([in]BYTE* bytArray).
This method has to get a Byte array from client and
utilise the values of the array.
When iam calling this Interface method from client by
passing a byte array of size 10, at the server iam
only able to access the first element of the array.
i.e only first element of the array is marshalled from
client to Server. This is happening only in the case of
OUTPROC Servers. How can i access the entire BYTE array
without utilising VARIANT or SAFEARRAY concepts?
modified on Tuesday, May 18, 2010 1:00 AM
|
|
|
|