 |
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
I make simple com exe server using win32 application, but when i used winconsole application it gives me error i.e com component can not be created, is there any change in settings of visual studio or in code.
plz help me out.
|
|
|
|
 |
Hi, Member 9899644,
Your post provides no real information about your simple com exe server. It is impossible to diagnose your problem. There are so many possibilities for error that I'm not even going to try to guess.
|
|
|
|
 |
I am trying to build Simple COM Exe Server which provide single interface and interface has one method, when client called the Exe Server then using the command line parameter server guess that client is of regular(show window) client or COM(want interface pointer) client. If client is of COM client then method which is register Class Factory object is get called using CoRegisterClassObject() class factory object is registered and object of Concrete class is created and return the interface pointer. this all is done, but when i make COM Exe server usssing Console application (template in visual studio) then CoRegisterClassObject()is not create the concrete class object and not return interface pointer.
Is there any changes when we create exe server as win32 application and console application.
|
|
|
|
 |
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.
|
|
|
|
 |
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
|
|
|
|
 |
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
|
|
|
|
 |
Hi,
I followed Microsoft Knoweldge base Article 178749
http://support.microsoft.com/kb/178749[^]
To create and an Automation When I got the Class wizard I selected Create Class from typelib
I the selcted the excel.exe
The Wizard create a number of Class I slected to include all of them in my project
After getting a Clean build I decided to add some ole code
create excel
So I included "CAppliction.h"
I coded CApplication app;
app.CreateDispatch("EXCEL APPLICATION");
however I got a whole slew of build errors
example
c:\users\4rypb\documents\visual studio 2010\projects\autoproject\autoproject\debug\excel.tlh(1595): error C2371: 'FontPtr' : redefinition; different basic types
1> c:\program files\microsoft visual studio 10.0\vc\include\comdef.h(314) : see declaration of 'FontPtr'
or
c:\users\4rypb\documents\visual studio 2010\projects\autoproject\autoproject\capplication.h(3): warning C4278: 'RGB': identifier in type library 'C:\\Program Files\\Microsoft Office\\Office14\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
Am I mssing some include ?
The doc says include excel8.h
but I dont see that included generated
Thanks
|
|
|
|
 |
there's going to be different headers eg excel8.h, for different versions of Excel - you've already said you're using Excel 2010, so, an alarm bell goes off in my head straight away on that score ...
as to the rest, its been a long time since Ive needed to do this, but I found this article here in CP that may give you some more (and definately) better guidance ..
Automating Excel 2007 and creating charts using C++ MFC application in Visual Studio 2008[^]
(before you shoot me down in flames, please have a look at the article - it suggests it should be good for Excel 2010 as well, else I wouldnt have posted it)
|
|
|
|
 |
commented out #import
Tnanks
|
|
|
|
 |
Hi,
i am working for windows 8 wrapped credential provider .i did every thing in document which is provided by Microsoft .i implemented ICredentialProviderCredential2 interface with GetUserSid(__deref_out PWSTR *ppszSid) method,i am able to get sid .but my credential provider showing like other user tile ,but widows default credential showing password text box only,why my credential showing username text box and password text box. please help about this
Thanks
modified 24-Jul-13 4:55am.
|
|
|
|
 |
Hi
I have developed Window service in .Net 2010 and in that windows service we are using Word COM object to covert DOC to PRN file.
if i run the window service in my local its working fine, but if i deploy the window service in Server 2008 R2 server i am getting below mentioned error, (Server 2008 R2 server Word 2003 is installed)
There is insufficient memory. Save the document now. (C:\...\ACL-PhillipSholar_1482.doc)
source Microsoft Word [System.Runtime.InteropServices.COMException]
at Word.Documents.Open(Object& FileName, Object& ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles, Object& PasswordDocument, Object& PasswordTemplate, Object& Revert, Object& WritePasswordDocument, Object& WritePasswordTemplate, Object& Format, Object& Encoding, Object& Visible, Object& OpenAndRepair, Object& DocumentDirection, Object& NoEncodingDialog, Object& XMLTransform)
If any one know how to resolve the issue, Please let me share your fix.
Regards,
Ganesan. B
|
|
|
|
 |
hi,
in my dll i am calling win32 dialog with custom control it working in 32 bit windows 8 machine but it is not display in 64 bit windows 8 machine. anyone tell me solution .
Thanks
|
|
|
|
 |
You will need to provide a lot more detail if you want assistance with this.
Use the best guess
|
|
|
|
 |
my dll is custom credential provider .this dll provide a link in windows logon screen,this link will display win32 dialog with custom control.this is working for windows 7 32&64 bit and windows 8 32bit.but 64 bit windows 8 every thing is coming fine dialog only not displaying .
Thanks
|
|
|
|
 |
venkatesh52867 wrote: dialog only not displaying . Well that's the second time you have told us that, but without a lot more information it's anyone's guess what is happening.
Use the best guess
|
|
|
|
 |
Hi,
i have implemented two interfaces in
class CSampleProvider : public ICredentialProvider,public ICredentialProviderSetUserArray
{
....
STDMETHOD (QueryInterface)(REFIID riid, void** ppv)
{
HRESULT hr;
if (IID_IUnknown == riid ||
IID_ICredentialProvider == riid || IID_ICredentialProviderSetUserArray )
{
*ppv = this;
reinterpret_cast<IUnknown*>(*ppv)->AddRef();
hr = S_OK;
}
else
{
*ppv = NULL;
hr = E_NOINTERFACE;
}
return hr;
}
........
};
it is building with out errors .but when i execute dll logonui is
crashing .how can implement two interfaces in one class please help me
|
|
|
|
 |
|