|
VitalyTomilov wrote: I can see in debugger of VC++: [Frames below may be incorrect and/or missing, no symbols loaded for rpcrt4.dll] coming from the C# client.
Can you post the stack trace?
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Please see my answer there below... It's a nice one ))
Free C++ libraries with source code on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
I seem to have found the problem, which also is a horrible revelation, another .NET bug, I think… So, this is what it was…
In a simple scenario, you bind COM event to your C# handler via += operator, for YourInterfaceVariable.EventName += New MyHandler, which seems to do the job fine.
Now consider a little more complicated scenario, where your main interface doesn’t expose events. Instead, it exposes a property of another interface, which in turn exposes events. Now, you want to attach a C# event handler to that internal interface via the property, obviously, so you give the command: VariableName.PropertyName.EventName += new MyHandler.
By all logic, this must work, and it even does, for a while, a few calls, 10-30, as all-of-a-sudden, your events stop coming in!!! You start asking yourself why, and the answer is astounding: C#/.NET doesn’t support such internal references properly, and at some point they seem to get into the automated garbage collection, or so it would seem. How do I know? That’s simple: I declared another variable of type of the internal event interface, then set it at run time, and did C# binding onto that variable instead its reference through the containing interface. And that solved the problem, the event handler no longer looses the connection.
Now how do you like THEM apples! Am I far indulging into Microsoft hatred or that’s really another screw up on their part?
Any comments are welcome.
Free C++ libraries with source code on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
can you show me an example of the same ...
i am using WWVDashboard.ocx inside my project
WWVDashboardClass dashboard = new WWVDashboardClass();
dashboard.OnGetImgPath += new WWVDashboardEvents_OnGetImgPathEventHandler(dashboard_OnGetImgPath);
// RECEIVING ERROR ON THE NEXT LINE
dashboard.OnGetpicture += new IWWVDashboardEvents_OnGetpictureEventHandler(dashboard_OnGetpicture);
dashboard.OnGetThumbInfo += new IWWVDashboardEvents_OnGetThumbInfoEventHandler(dashboard_OnGetThumbInfo);
.. also it has got several interface like
IWWVDashboardEvents_Event (internal event interface)
i had read your previous reply but
i dont know how to achieve that....please help me out.
|
|
|
|
|
Do you want to replicate the problem i had or to solve the problem?
This problem came to me a while ago, i posted it on Microsoft, they recognized the problem and said that the workaround that i came up with myself was the rigth way, which sounded kind-of bad.
Anyways, if you have a property that exposes COM events, you need to declare a global variable of the property type, then set the variable from the beginning, and only then attach events to your global variable. You cannot attach events directly to a property that exposes events, because such event attachment gets automatically garbaged by .NET after some time, so you stop receiving events permanently.
Regards,
Vitaly
|
|
|
|
|
thanks for your instant reply....
|
|
|
|
|
I have The Menu in javascript on master page
and On content pages There are drop down lists
when we extract the menus The Drop down List On Content Page
Comes Over The javascript Menu In IE no problem with mizilla
Is there any Solution....
Thanks
swapnil
|
|
|
|
|
I think you are using IE7. This type of pronle may occur in IE7. you have o change the javascript according for IE7. Run these pages on IE6.0.
help as a alias.
Be happy and make others happy.Cheer up...........
|
|
|
|
|
I'm using the GIT (in my OOP server) to hold dispatch interfaces to my clients. Occasionally the call to GetInterfaceFromGlobal() hangs. The only other time I've seen this is when I run a test client in the debugger.
So any clues as to what the client could be doing to block GetInterfaceFromGlobal()? It doesn't appear to be CPU bound but I'm guessing it's not allowing some behind-the-scenes messaging to run. It does eventually stop whatever it was doing and everything then carries on fine.
|
|
|
|
|
|
Hi,
I'm trying to run WMI queries against a server in a C# application. I'm pretty sure my code and provided DB/User/Password is ok. On the connect command the following error is raised:
"Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
<br />
ConnectionOptions oConn = new ConnectionOptions();<br />
oConn.Username = strUsername;<br />
oConn.Password = strPassword;<br />
oConn.Impersonation = ImpersonationLevel.Impersonate;<br />
<br />
System.Management.ManagementScope oMs = new System.Management.ManagementScope("\\\\domain\\servername\\root\\cimv2", oConn);<br />
<br />
oMs.Connect();<br />
I'm fairly sure its a privileges problem. I'm using a username and password that has admin privileges on the server. I've allowed remote administration and granted DCOM remote launch permissions. Any idea would be much appreciated!
thanks!
|
|
|
|
|
|
Hi All
I have to create a c++ managed wrapper class that uses System::String for an unmanaged class that uses std::string.I need to use the managed dll in C# web application.so can anybody tell me the steps or how to wrap an unmanaged class in an managed class and how to import that dll in my c# project so that i can access the functions of that dll.I m wondering for that right solution for 3 weeks.
Thank in advance
Pankaj Jain
|
|
|
|
|
Hi
I would like to create a COM which is used to generate PDF from HTML content ..
but i don't have any idea on creating com for pdf ..
can anybody give me some fundamentals of creating com for pdf ..
N.Rajakumar B.E.,
Application Developer,
|
|
|
|
|
Hi every body
I am doing a project in which I have a Windows Certificate Authority server and RADIUS server (IAS RADIUS server under windows ) . In this project the clients will login to the domain and get certificates from CA. I know this can be done through Windows configuration, but it's not good. I want to understand what is going behind, so I want to develop my own code. In brief, My question is :
I want to do certificate enrollment and request through C# program. I saw many codes in websites. They are using XENROLL.dll library to do enrollment, but I couldn't understand. Sorry I am still new in C#, so I need any tutorial or guide about this to guide me how can I do it.
I don't know from where these guys got tutorials about Certifcate enrollment, request ...... etc
It's hard to start a project on this without deep understanding of the methods used and classes.
Here is an example of the codes I found. This to give you a total figure of what I mean. Of course, this code is not complete and probably has some mistakes.
*****************************
int creationState;
string CertificateTemplate = "My Certificate Template";
string ProviderName ="Microsoft Enhanced Cryptographic Provider v1.0";
string EmailCertOID = "1.3.6.1.5.5.7.3.4" ; //Email certificate
// creating cert request:
XENROLLLib.CEnroll certEnroll = new XENROLLLib.CEnroll();
certEnroll.GenKeyFlags = 1024 * (256*256);
certEnroll.GenKeyFlags = CRYPT_EXPORTABLE;
certEnroll.UseExistingKeySet = 0;
certEnroll.ContainerName() = cert;
certEnroll.addCertTypeToRequest (CertificateTemplate);
certEnroll.ProviderName =ProviderName;
string dn = "CN="+ CommonName.Text +",E="+ Email.Text +",O="+
Organisation.Text +",L="+ Stadt.Text +",S="+ State.Text
+",C="+Countrycode.Text+"";
string req = certEnroll.createPKCS10(dn, EmailCertOID);
int CR_IN_BASE64 = 0x1;
int CR_IN_PKCS10 = 0x100;
CERTCLIENTLib.CCertRequest certRequest = new CERTCLIENTLib.CCertRequest();
creationState = certRequest.Submit(CR_IN_BASE64 | CR_IN_PKCS10, req,
"", @"Certserver\MyCertCA");
***************************************
Please Please Please if any one know something about this PLEASE AGAIN guide me. It is toooo urgent. I have just two months to submit the project.
Please I need at lease a tutorial.
Thanx to ALL
|
|
|
|
|
Can anybody help in how to implement print preview in XOffice source code. Interface is 'IInplacePrintPreview' and method is 'StartPrintPreview'.
|
|
|
|
|
I have a DCOM based project.
I use RPC to query database(using SQL Server 2000).
But when the Server program run on Windows 2000 server,the client using the data querying well,that I mean query speed is not slow.
But when I run the service on Windows 2003 Server,the client's query speed is almost as slow as 1 of 8 of running in Windows 2000 Server.
Someone would tell me Why?
Thanks.
GOOD LUCK
|
|
|
|
|
Hi,
I guess that I should use IDockingWindow::ShowDW method, but how do I get
pointer to IDockingWindow ? I want to show/hide Quick Launch deskband.
thanks
Vilius
|
|
|
|
|
I am working on a tool the uses .net to automate a com program. ESRI ArcDesktop to be exact. My production box started failing on my nightly runs. I get an Exception from HRESULT: 0x80041018 which all I can find is this: http://msdn2.microsoft.com/en-US/library/aa383513.aspx
Which states that :
WBEM_E_INVALID_QUERY_TYPE The requested query language is not supported
2147749912
0x80041018
Does anybody have any ideas?
.net code below
<br />
Private Function PackagePMF(ByVal strPMFFile As String, ByVal strPackageDIR As String) As Boolean<br />
Dim pPE As IPMFPackage<br />
Dim pSettings As IPropertySet<br />
Dim pCancel As ITrackCancel<br />
Dim pArray As IStringArray<br />
Dim strFullPMF As String<br />
<br />
Try<br />
ts.TraceEvent(TraceEventType.Verbose, 0, "StartPackage Function " & Now)<br />
pPE = New PackagerEngineClass()<br />
pSettings = pPE.GetDefaultPackagerSettings()<br />
pCancel = New CancelTracker<br />
pArray = New StrArray<br />
<br />
'All Vector data will be converted to Shapefile.<br />
'All Raster data will be converted to ERDAS Imagine.<br />
pSettings.SetProperty("Vector Clip Type", esriAPEVectorClipType.esriAPEVectorClipTypeCopyDataset)<br />
pSettings.SetProperty("Raster Clip Type", esriAPERasterClipType.esriAPERasterClipTypeCopyRaster)<br />
pSettings.SetProperty("Package Directory", strPackageDIR)<br />
Debug.WriteLine("Package Setting Set: " & Now)<br />
<br />
'Specify the name of the pmf to be packaged<br />
ts.TraceEvent(TraceEventType.Verbose, 0, "Pmf to be Packages... " & strPMFFile)<br />
strFullPMF = strPMFFile<br />
pArray.Add(strFullPMF)<br />
<br />
'Package the pmf with the specified settings <br />
pPE.Package(pSettings, pCancel, pArray) X| Line the code fails on. X| <br />
ts.TraceEvent(TraceEventType.Information, 1, "Packaging is complete for : " & strPMFFile)<br />
Return True<br />
<br />
Catch ex As Exception<br />
ts.TraceEvent(TraceEventType.Error, 1, "PackagePMF: " & ex.Message & ex.StackTrace)<br />
Return False<br />
Finally<br />
strPMFFile = Nothing<br />
strPackageDIR = Nothing<br />
pPE = Nothing<br />
pSettings = Nothing<br />
pCancel = Nothing<br />
pArray = Nothing<br />
<br />
End Try<br />
End Function<br />
<br />
|
|
|
|
|
Hi,
Can any tell me what is the difference between BSTR, CComBSTR, _bstr_t? and which one to use when?
and also What is difference between VARIANT, CComVariant, _variant_t? and which one to use when?
Thanks
Nandu.
|
|
|
|
|
|
Hi,
Below is the list of advantages of COM. Please correct me if I am wrong and also let me now whether I covered all the advantages of COM (whether I have missed any of the major advantage of COM )
1) Ease of Application customization
2) Language independent
3) Reuse of application architecture
4) Secure access of object since it is binary format
Let me know if there is a better way to put the above advantages.
Nandu
|
|
|
|
|
Can any one reply to the above questions.
Thanks in advance,
Nandu
|
|
|
|
|
Hi,
Can any one tell me how to handle exception in COM or provide me the link where I find the relevent information.
Thanks in advance
Nandu
|
|
|
|
|
Hi Nandu,
COM does not throw exceptions as they are language specific and cannot cross the COM boundary.
What usually happens, especially if using #import (visual C++) is that a thin wraper is made around the COM function call, this detects the HRESULT failure of the COM call and throws an exception itself back to your C++ code.
Other languages may do the same, but non of them throw exceptions accross the COM boundary.
regards,
|
|
|
|
|