|
Hi all.
I'm having a really annoying issue generating a type library from a COM component written in .NET. Actually the class library was coded by another employee who has since left, so I am stuck trying to properly compile it.
Basically there is an interface IParameterData that has a number of properties all starting with I (upper case i) and ending in ID. However, when inspecting the generated type library the case has been changed on the first I (to lowercase) and the final D. This happens on 4 out of roughly 12 parameters.
The strange thing is that the type library is generated fine on one particular pc, but on 3 others I have tried it is incorrect.
Has anyone had similar issues with this? Is it because of old entries still in the registry? I have tried deleted old registry entires but to no avail.
Any help with this would be greatly appreciated
|
|
|
|
|
|
Hi,
I have to export data from a database to Excel via VB.NET 1.1. And I am having all kinds of issues.
I honestly do not know what to do, I have searched high and low. Is there another way of exporting data from the database to Excel via VB.NET. I have to do everything in VB.NET.
This is my error:
"ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user."
I read an article on the Internet and they said that I must add the following to the web.config file:
<identity impersonate="true" userName="youradminuser" password="youradminpassword" />
..but what username and password is this?
Regards
ma se
-- modified at 2:53 Friday 15th June, 2007
|
|
|
|
|
Dude, you are in the wrong forum.
Anyways, for a Windows application you can easily use the Excel interfaces provided by Microsoft to do the job.
---
Hakuna-Matata
It means no worries for the rest of your days...
It's our problem free, Philosophy
"I think my response was 'What idiot dreamed this up?'" -- Mary Ann Davidson, Oracle's chief security officer, in typical blunt manner, remembering her reaction to the company's scheme to brand its databases as "unbreakable."
|
|
|
|
|
Hi to All,
I created one ClassLibrary in .Net using VB.Net, which is configured for COM InterOP. In this Library, I created 3 classes and below they are.
(1) Document class: which is having 2 properties
(a) AddPage : function for adding a Page to the Document.
(b) DrawToFile : method which 'll draw the output to the specified file.
(2) Page class: Having a AddLabel function used for adding a Label to the Page.
(3) Label class: having 2 functions and 1 Event.
(a) Text function: which is used to Set or Get the Text of the Label.
(b) TextColor function , which is used to Set or Get the Text of the Label.
(c) TextColorChanged event
Now, In Vb 6, by referencing the TypeLibrary for the .Net ClassLibrary, I am able to code as I required. And the code , what I have written in Vb 6 is below.
Public WithEvents mylabel As ClassLibrary1.Label
Public doc As New Document
Private Sub Command1_Click()
Dim page As page
Set page = doc.AddPage
Set mylabel = page.AddLabel("ceTe Software,Mysore,India", 10, 10, 300, 20)
doc.DrawToFile ("c:\t.pdf")
End Sub
Private Sub Command2_Click()
mylabel_TextColorChanged (Text1.Text)
doc.DrawToFile ("c:\t.pdf")
End Sub
Private Sub mylabel_TextColorChanged(ByVal value As String)
mylabel.TextColor = value
End Sub
My need is to implement the same in Classic ASP.
Anyone, write the code in Classic ASP for me, as I donot know how to do this in Classic ASP.
Thanks in Advance,
Murty
|
|
|
|
|
I created a regular COM object with ATL, it worked fine by using the CoCreateInstance(), and then install the COM object to a COM+ application with Component Services administrative tool, when I try to call CoCreateInstance in my client code, I got "no such interface supported" error, the returned HRESULT is "Class not registered". class can be seen in OLE/COM Viewer, but it doesn't expose custom interfaces (only IUnknown, IClientSecurity, IMultiQI and IMarshal). But if I delete the object from COM+ application, and just register the component with regsvr32 command, my client works, again.
Anything I have missed when I installed the component into the COM+ application?
|
|
|
|
|
Hi,
I'm planning to implement a chat server + a chat client as a learning exercise for my ATL/COM/DCOM.
As part of that first I would implement a chat server which is a local server and a chat client. Please suggest if the following is possible, if true how.
Clients register their callbacks by using Advice() (Of course, I would do FindConnectionPoint(), before that ). My doubt is is there any way to send the notification from the server to all the clients? and also can the server select the client to which it has to send the notification.
For Example: User1, User2 are currently logged in. If user1 sends a message to User2 by using SendMsg(from, to, msg) of IChatServer, can the server alert client of User2.
Otherwise can server broadcast the event??
Thanks and regards,
Raja Pratap
|
|
|
|
|
Hi,
I desperately need some help on getting started on an browser helper object for Internet Explorer.
What I want is basically a very simple thing: two buttons in the link bar, of which one activates a predefined page (just regular link button functionality), while the other does the same, but adds the web page that is currently visible as attributes. To spice things up, they could be collected in a toolbar with a company logo, but that is extra.
I have made this in Delphi about a year ago, but I never got the button sizing working good (in fact the toolbar did WEIRD things to Internet Explorer layout when dragging and dropping this), so my problem is not that I do not know about IDispatch and IWebBrowser and stuff, but mainly how I can program the two link buttons.
I have the feeling that such a BHO has been made many times, but I wouldn't know where to start.
Any help would be greatly appreciated!
Thanks
Kees
Keesp
"You should have an open mind, but not so open that your brain falls out"
|
|
|
|
|
I try to use FileSystemObject in VC6 via "#import "scrrun.dll""
<br />
IFileSystemPtr spFso(__uuidof(FileSystemObject));<br />
ISupportErrorInfoPtr spSupportE = spFso;<br />
HRESULT hrRet = spFso->raw_MoveFolder(_bstr_t(pwszSrc), _bstr_t(pwszDst));<br />
For testing, I assigned pwszSrc and pwszDst with invalid paths.
I find that IFileSystem does not support ErrorInfo coz the interface pointer in spSupportE is NULL. The value of hrRet is 0x800a004c, which can not be processed by FormatMessage(). So after MoveFolder() fails, I can't get any error message.
However, I used VB to call the same function and got error message "Path not found". How does VB do that? How can I get the same message in VC?
|
|
|
|
|
Well, 800a004c is CTL_E_PATHNOTFOUND (olectl.h), so you probably need to point FormatMessage at the right DLL...
Steve S
Developer for hire
|
|
|
|
|
I think the common way of using FormatMessage is like this:
<br />
LPWSTR pwszMsg = NULL;<br />
<br />
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL,hr, 0, (LPWSTR)&pwszMsg, 0, NULL);<br />
How can I know which DLL to point and generate correct message?
Thanks.
|
|
|
|
|
You could try the one you're #import-ing. You're quite right about that being the most common way, though.
Steve S
Developer for hire
|
|
|
|
|
I'm having a problem when calling Excel from within C#.
i have a routine which goes something like this:
<br />
m_Workbook.Addsheet(1) ...<br />
.
.
.
later, m_excelApp (my excel application object) is "Quit":
<br />
m_excelApp.Quit();<br />
This code all works fine. However, after the user closes the Excel workbook (either in the code (via a button) or with the close button on Excel), and I call the above code again, I get an error (at the m_Workbook.Addsheet(1) line):
The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
I havent got the faintest what this means (the msdn site doesn't seem to be very helpful regarding a solution) so if anyone could lend us a hand with some advice that'd be highly appreciated!!
Many thanks,
Gerry
COM newbie
|
|
|
|
|
The COM object you're using is a proxy since Excel is a separate application. This proxy object communicates to a stub inside Excel using RPC to provide the illusion that you’re directly driving Excel. If Excel “dies” or is closed down the stub (which lives inside Excel) no longer exists, but the proxy (which lives inside your application) still exists: in this situation any attempt to call a method on the proxy returns RPC_E_DISCONNECTED since the target object no longer exists.
Steve
|
|
|
|
|
Wow thanks Steve for a very educating response!
Can I ask what a way of getting around this might be?
Do I need to kill my m_excelApp object completely? (and if so how??)
Many thanks,
Gerry
|
|
|
|
|
When you get the error the application you're controlling no longer exists; how you respond is up to you. You could pop up an error message for example.
Steve
|
|
|
|
|
OK thanks steve but what if I need to access the application again?
Can I simply recreate the m_excelApp object?
Many thanks for your help!
Gerry
|
|
|
|
|
You can recreate another object, but this may launch another Excel instance. If you're driving an Excel which contains data you want a new instance isn't of much use.
Steve
|
|
|
|
|
Hi.
When I coded a queued component using .NET, I set the activation type to Library.
But, the queued component didn't work.
In the case of Server, it did work.
Can anyone tell me the reason kindly?
Thank you.
Mr. SYH
|
|
|
|
|
Hi,
I am a newbie to COM.
(Part - I)
I have created a VS2003-ATL project and a ATL class(MyClass) in it.
I registered the output dll with regsvr32 (Result - succeeded).
(Part - II)
Next in order to use this COM class(MyClass), I created a VS2003-MFC exe project.
Used the "Add References" to add the COM reference. (Result - I can see the component added in References)
Now I need to use the MyClass in the project. How do I do this?
Any help,links will be appreciated.
|
|
|
|
|
Hi people,
I have an ASP.NET application that uses a COM (locally) to do some number crunching. Everything works fine when the COM is installed on the same machine as the web application. In fact, the ASP.NET application uses a web service to access the COM. The web service is also on the same machine.
Now, for performance reasons, we have decided to distribute the COM to several machines on the network so that we can have some distributed computing. I am not the one who is responsible for the COM development. For testing purposes, we have installed the COM on a remote machine and have created a .NET assembly that will interact with it.
First, I tried the concept using a console application. I reference the assembly, instantiate the class and perform the calculations. The COM works fine on the remote machine with no problems.
Now I am trying to make the ASP.NET application do the same thing as the console application but it's not working. I reference the assembly in my web service code but the call fails.
I know that the COM needs to be configured on the remote machine to allow access and execution. I have noticed that the account that should be used to contact the COM should be a domain account. When I run the console application from my machine, the Dllhost process on the remote machine shows well my username as owner.
I have suspected that because the web application runs with the ASPNET account, it wasn't allowed to run the COM on the remote machine. I have tried using impersonation to switch to my account inside the web service code. The impersonation works fine inside the code. When I debug, I can see that the Environment.UserName field goes from ASPNET to my username. However this doesn't solve the problem.
To check if the impersonation was working, I have tried calling my console application from inside the web service application using the Process class. When I go to the taks manager to see the processes list, I see that ASPNET is the owner of the console application. I have tried calling notepad also and I got the same thing.
So my first questions are:
Does impersonation work only inside the code? Why is my process running under ASPNET?
I have also read some things about delegation to allow a COM to be called across a network. I did some research about the matter and there were some things that needed to be set by the admin, to allow the impersonating account be used for delegation and the impersonated account also. We did all that but still it's not working. I'm sure I'm still missing a lot of stuff since I didn't find any article online that would explain the whole process.
My second question is:
Can anyone point to a URL or maybe explain to me how this delegation works? or maybe if someone has a way to launch a COM across the network, some tips, etc...
Thank you all for your efforts.
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Hi,
I'm a new dotnet developer and i always hear of COM and COM Components. What is it and why is it used? can u pls explain me abt it?
Regards
Vijay.
|
|
|
|
|
COM means Component Object Model and its a (binary) standard, language-independent, for Creating objects that can interact.
See here http://msdn2.microsoft.com/en-us/library/ms680573.aspx[^].
Event the first period of the above page:
COM is a platform-independent, distributed, object-oriented system for creating binary software components that can interact.
gives a lot of info about.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Hi.
Anyone can tell me about COM+ and DCOM.
Are those same or different?
Please let me know it or any reference url.
Thank you.
Developer
|
|
|
|
|