|
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
|
|
|
|
|
I have not managed to find a decent explanation for either of the error codes you received. All I can suggest is that you test with a Unicode and ASCII version of the string, and be sure that the path to the file is correct.
Veni, vidi, abiit domum
|
|
|
|
|
Hello,
I'm trying to solve one problem with custom cred.prov. on win8.
The problem is that if you select any tile (e.g. my, custom) and you have CPUS_UNLOCK_WORKSTATION scenario - Logonui will dismiss it automatically after 1 minute. This is not relevant to CPUS_LOGON scenario. Selected tile will stay untill user press Ok or Cancel buttons.
So I'd like to ask, maybe somebody has worked with such thing already, is it possible to handle that moment when selected tile is going to be dismissed.
using debugging I found that IConnectableCredentialProviderCredential::SetDeselected() is not called when IConnectableCredentialProviderCredential::SetSelected() is called by selecting the tile.
|
|
|
|
|
|
|
Seems like the above error has to do with access rights
I am running windows 7
I right click on the file and under the security I see everything checked off but the special permissions don't know if that would be the problem
|
|
|
|
|
Without information on the context in which you receive the error it is impossible to speculate.
Use the best guess
|
|
|
|
|
Here is the code
COleVariant myvar;
myvar.vt = VT_I4;
myvar.lVal = NULL;
COleVariant Orgin((short)3),
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(_T("C:\\FILE\\EXCEL.TXT"),
Orgin,
StartRow,
DataType,
myvar.lVal,
ConsecutiveDelimter,
TAB,
Semicolon,
Comma,
Space,
Other,
OtherChar,
FieldInfo,
TextVisualLayout,
DecimalSeprator,
ThousandSeprator,
TrailingMinusNumbers,
Local);
|
|
|
|
|
Hi
I lookend filename in memory and every letter is seprated by a NULL X'00' so C: is 43005C I am out of my debugging session but I think 5C is :
Thanks
|
|
|
|
|
That just means it is a Unicode string. I have explained to you a number of times about your mishandling of Unicode and ASCII strings, and I suspect this is just another example.
Use the best guess
|
|
|
|
|
in excel, when enter a cell.no VBA functions are available.
how can I get the character or word after the cursor. or the whole line where the cursor located.
Any tips or reference will be appreciated.
I have done a lot research, but still have no idea.
|
|
|
|
|
Hi,
I am trying to open text file into a Excel Spreadsheet and I am getting all kinds of exceptions
below is my code as all but the filename paramter is optional I am wondering if someone can post a
example
COleVariant myvar;
myvar.vt = VT_I4;
myvar.lVal = NULL;
books.OpenText(TEXT("C:\\DOCUMENTS\\MYFILE.TXT"),
covOptional,
covOptional,
covOptional,
myvar.lVal,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional);
|
|
|
|
|
ForNow wrote: I am getting all kinds of exceptions You really need to show the exceptions, rather than hoping people can guess what they are.
Use the best guess
|
|
|
|
|