|
Member 9899644,
Sorry for not replying to your post, I completely forgot about it.
It sounds as though you are just learning about COM and it's associated functionality. This can be very difficult, because, typically, all you need to do is ignore one aspect of the creation and activation paradigm, and the whole thing just fails to operate as expected (and, you have no idea why).
When I was first trying to understand COM (syntax and the reasons it was designed in such a way), I found that reading Don Box's book: Essential COM was extremely helpful. You need an overview, and you need to understand why COM does what it does, and, to read some example source code.
As I recall, there are some excellent articles right here on the CodeProject about registering a COM server. Also, you don't mention how your COM client activates the object,...this is typically done with CoCreateInstance.
This is an excellent introductory series to COM: The COM Macro-Architecture Topology,
...and,...COM Macro Architecture Topology - Servers,
...and,...COM Macro Architecture Topology - Clients,
and,...COM IDs & Registry Keys in a Nutshell.
...Also, Michael Dunn has an excellent series on COM: Introduction to COM - What It Is and How to Use It., and,...
Introduction to COM Part II - Behind the Scenes of a COM Server
Several incredibly informative articles about COM are written by: Lim Bio Liong
Understanding The COM Single-Threaded Apartment Part 1,
...and,...Understanding The COM Single-Threaded Apartment Part 2
Jeff Glatt also has an excellent series: COM in plain C
COM in plain C, Part 2
COM in plain C, Part 3
COM in plain C, Part 4
COM in plain C, Part 5
COM in plain C, Part 6
COM in plain C, Part 7
...and, COM in plain C, part 8
In fact,...there is a HUGE list of CodeProject articles about COM: COM / COM+
modified 5-Aug-14 18:40pm.
|
|
|
|
|
i'm using the reference Microsoft.Office.Interop.Visio to create a visio drawing document. When trying to obtain a visio application in my c# program as follow : "Application application =new Application()", i got the error below:
La récupération de la fabrique de classes COM pour le composant avec le CLSID {00021A20-0000-0000-C000-000000000046} a échoué en raison de l'erreur suivante : 80040154 Classe non enregistrée (Exception de HRESULT : 0x80040154 (REGDB_E_CLASSNOTREG)).
When using the same type of reference such as "Microsoft.Office.Interop.Word" or "Microsoft.Office.Interop.Excel" everything works properly. Any suggestion on how to address this issue will be really appreciated. Thanks!!
|
|
|
|
|
The message is clearly telling you what is wrong: Visio is not installed on your system.
|
|
|
|
|
Thanks for your reply.
I have visio installed on my system trough Microsoft Virtualization application.
That is why, the COM for visio is not found comparing to the COM for Word or Excel which i directly installed on my system(locally installed).
How to access visio objet which is installed on a virtual server as it is my case from my c# program.
Any idea! Thanks
|
|
|
|
|
Well, as the message clearly states, Visio is not installed on the system that you are trying to access it from, so you have no choice but to install it. The real system and the virtual system are totally separate entities.
|
|
|
|
|
Ok, since it's still a Microsoft technology (i mean the virtualization application for software ), is there any way to access Visio without having to install its on my real system?
The fact is that the application Virtualization is an application streaming solution and i run visio manually without any issue.
Thanks for your interest and constribution 
|
|
|
|
|
Member 10825675 wrote: is there any way to access Visio without having to install its on my real system? No, As I said before the two systems are entirely separate; it is the same as having two different PCs.
|
|
|
|
|
I installed a visio trial version and everything works perfectly!
Thus i will need to locally install visio on each sytem of my network instead on having its installed on a server and using client app to acess its in order to run my soft. This is the issue actually.
Anyway, thanks for your valuable contribution.
|
|
|
|
|
I faced the same error while accessing it from server.
what i did is, changed the application pool identity in application pool on IIS.
Identity should be the one which has administrator rights to use that application where it is installed.
It worked fine after that.
Hope it works for you too.
|
|
|
|
|
Where can I update the edit field to reflect changes of the file name to save?
I have customized my save file dialog and use CFileDlgEventHandler. There i need to set a different filename.
In the file save dialog I select a filename from existing files, e.g. blah.tif. After clicking a custom checkbox I need to set e.g. blah_C1.tif. I can get and set the filename inside the handler:
CComQIPtr pDlg = pfdc;
pDlg->GetFileName(...) and pDlg->SetFileName(...) work,
but after clicking 'Save' I get the filename previously selected (blah.tif) and not the changed one.
Anyone out there with a tip to update the edit control behind the scenes?
|
|
|
|
|
|
Thanks. Tried it, but without positive result.
The problem is, that the filename is saved anywhere else behind the scenes (comdlg32.dll?). Changing the edit box does not help.
I'm stuck...
|
|
|
|
|
Hi, All
How to create a simple COM component in C++, and then to consume it in my C# project.
I don't want to use ATL. Are there any simple step by step instructions or a complete procedure to get started. (I have done googling but not found any desired content).
Any help will be appreciated.
Best Regards,
SD Khan
|
|
|
|
|
|
when you starting with new technology first need to read a books regarding that. then google it. for com i suggest you "Inside COM" by dale rogerson and "essential COM" by Don Box.
All the best..
|
|
|
|
|
Hello, I recently started programming with COM Objects Catalog using C-Sharp.
In principle, everything turned out pretty simple and I managed crar COM objects, install them and make them visible from the console, register and configure some properties of automatic way.
However I am with some problems as it relates to the configuration of some properties, namely:
While I can configure the identity component, either as INTERACTIVE USER or a specific user, I could not configure the identity of the COM + application with the Auditors Local System (Local System, Local Service and Network Service)
I do this as follows:
Boolean resultado = false; ;
ICOMAdminCatalog catalog;
ICatalogCollection applicationCollection;
ICatalogObject application;
int applicationCount;
int i;
try
{
catalog = (ICOMAdminCatalog)new COMAdminCatalog();
applicationCollection = (ICatalogCollection)catalog.GetCollection("Applications");
applicationCollection.Populate();
applicationCount = applicationCollection.Count;
for (i = 0; i < applicationCount; i++)
{
application = (ICatalogObject)applicationCollection.get_Item(i);
if (application.Name == nombreApp)
{
application.Value["ApplicationAccessChecksEnabled"] = false;
application.Value["Identity"] = "Interactive User";
applicationCollection.SaveChanges();
application.Value["Identity"] = txtUsuario.Text;
application.Value["Password"] = txtClave.Text;
applicationCollection.SaveChanges();
}
catch (Exception ex)
{
resultado = false;
MessageBox.Show(ex.Message);
}
}
Can you think how to configure the Local System Account? I tell them that if IDENTITY indicated in the following:
@ "nt authority \ LocalService"
and PASSWORD "" (empty)
Everything goes well, but in reality is set to a specific user with the supplied information.
From already thank you very much! 
|
|
|
|
|
Hey,
i have some .swf decompiled and i can see all the .as files in it.
so now i want to edit some variable in for example i want to edit the variable "x" in main.as
so i loaded the swf and when i want to setVariable I get the error:
"Error HRESULT E_FAIL has been returned from a call to a COM component."
you know how can I get the variable and change it?
|
|
|
|
|
I am writing a middleware library in .Net which will be invoking Web services and respond back to VB6 legacy applications with the service output.
So far I have made the assembly as ComVisible without generating strong-name for it.
The .Net dll will be used to generate a type library (.tlb) which can be added in Project References of the VB6 application and used to invoke the services.
Using regasm tool, the TLB file is generated fine and registered to the local registry.
I first registered the TLB from local system drive and everything worked fine.
Now the system constraint is that, the assembly and type library cannot be stored in end-user machines.
So I need to map to a network drive and register the TLB from there.
The regasm tool registers it from network drive also, but the VB6 application is not able to access the classes in .Net
Command used: WINDIR%\Microsoft.Net\Framework\v2.0.50727\regasm <dllname> /tlb /codebase <network folder path>
Whenever i try to create new object, it is throwing error '430-Automation error. Class does not support the expected interface'.
So I want to know how to resolve this issue?
|
|
|
|
|
I just can't seem to get this right.
I have a Com Class written in VB.Net that brings up a form where users can enter information.
I have a delphi program that opens this class and it shows the form fine.
The problem I have is with events raised in the Com Class. It just does not get fired in delphi, although I can assign it to a procedure.
Has anybody managed to do this?
|
|
|
|
|
You may be better posting this question in the Delphi forum.
Veni, vidi, abiit domum
|
|
|
|
|
Hi,
Here is the scenario.
IE9 loads a com activex, when an activex method is called, in the method it launches another com exe (registerless using manifest), cocreates and get the interface pointer then calls a method of that interface.
I am able to launch, cocreate and get interface pointer but when the method of that interface is called the following error is returned. "The group or resource is not in the correct state to perform the requested operation"
Can someone help me on this please?
Regards,
Hari
|
|
|
|
|
Hi
I am re-posting this as due to continued efforts I have not come up a solution to the bug
COleVariant
covTrue((short)TRUE),
covFalse((short)FALSE),
covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
CApplication app;
CWorkbooks books;
CWorkbook book;
app.CreateDispatch(TEXT("Excel.Application"));
books = app.get_Workbooks();
COleVariant myvar;
myvar.vt = VT_I4;
myvar.lVal = NULL;
COleVariant Orgin((short)2),
StartRow((short)1),
DataType((short)1),
ConsecutiveDelimter((short) FALSE, VT_BOOL),
TAB((short) FALSE, VT_BOOL),
Semicolon((short) FALSE, VT_BOOL),
Comma((short) FALSE, VT_BOOL),
Space((short) FALSE, VT_BOOL),
Other((short) FALSE, VT_BOOL),
OtherChar((short) FALSE, VT_BOOL),
FieldInfo((short) FALSE, VT_BOOL),
TextVisualLayout((short) FALSE, VT_BOOL),
DecimalSeprator((short) FALSE, VT_BOOL),
ThousandSeprator((short) FALSE, VT_BOOL),
TrailingMinusNumbers((short) FALSE, VT_BOOL),
Local((short) FALSE, VT_BOOL);
books.OpenText(L"C:\\PATH1\\PATH2\\PATH2\\FILE.TXT,
Orgin,
StartRow,
DataType,
myvar.lVal,
ConsecutiveDelimter,
TAB,
Semicolon,
Comma,
Space,
Other,
OtherChar,
FieldInfo,
TextVisualLayout,
DecimalSeprator,
ThousandSeprator,
TrailingMinusNumbers,
Local);
After executing
SCODE sc = m_lpDispatch->Invoke(dwDispID, IID_NULL, 0, wFlags,
&dispparams, pvarResult, &excepInfo, &nArgErr);
sc = 80020009 and execpInfo.scode = 0X800A03EC
|
|
|
|
|
I am trying to load the
.txt file specified in the first parameter of the OpenText API
And for some reason I get the feeling the source of the error
Is its not finding the file
I tried various variations on the file name as just specifying the file and having it in a directory
That's in the path variable but I still get the same error
Thanks
|
|
|
|
|
Are you sure the function requires a Unicode string for the filename?
Veni, vidi, abiit domum
|
|
|
|
|
I was told that automation functions
That take variant types in this case VT_BSTR a variant string are always unicode
|
|
|
|
|