|
Hi
I have a server which wil be fetching live Prices and i have to convert this server into a com+ service which wil be running on the server.. i to use the com + service in my aspx (i.e) webapplication . when ever the com + component raises a event i should be able to capture the event raised by the com+ service.. can we achieve this... Pls help me out
|
|
|
|
|
hi friend
Can any body tell me what is the advantages of .pfx file. and why we use it.
wasim khan
|
|
|
|
|
hI,
I am using the MSComm port for recieving data in c#.net while recieving data in parts from the OnComm event of mscomm i am not able to get the correct frame i.e. instead of 60bytes i am getting 80 bytes.
Can anybody tell the solution
|
|
|
|
|
tauras81 wrote: instead of 60bytes i am getting 80 bytes.
Well, you get 20 for free.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Firstly, if you're using .NET 2.0 or later you should be using the SerialPort class. The MsComm control is ancient and wasn't particularly good even with Visual Basic 6.0.
Secondly, serial communications are not framed - write boundaries are not preserved. You will get whatever is in the buffer when the read timeout expires, depending on how you've set up your serial port timeouts; this may be less than the number of bytes you requested.
"Multithreading is just one damn thing after, before, or simultaneous with another." - Andrei Alexandrescu
|
|
|
|
|
|
You must always match AddRef and Release calls. Do not rely on the return value of Release.
QueryInterface and CoCreateInstance add a reference implicitly, so they must always be matched with a call to Release.
"Multithreading is just one damn thing after, before, or simultaneous with another." - Andrei Alexandrescu
|
|
|
|
|
In VS6 C++, I have a windowless ATL control. To get a Device Context from the container, I belive I need to execute the GetDC() method of one of the base classes for the control, specifically IOleInPlaceObjectWindowless. I tried to do this:
CDC *pDC = IOleInPlaceObjectWindowless::GetDC();
But it doesn't work so I am at a loss as to how to execute a method on the IOleInPlaceObjectWindowless interface.
Any help would be greatly appreciated,
Thanks,
Doug
Doug Knudson
|
|
|
|
|
You can use methods exposed by interfaces ,only. Or you want to say smething else ?
|
|
|
|
|
Thanks for the reply. I didn't ask my question very well, but basically I am writing a windowless ATL component and need the Device Context from the Parent/Container so that I may draw in event handlers (for example, in MouseMove()). During my length time searching, all I could find was people saying that I needed to just execute the GetDC() method of the IOleInPlaceObjectWindowless interface like this:
HDC hDC = NULL;
HRESULT hr = IOleInPlaceObjectWindowless::GetDC(myRect,myFlags,&hDC);
The compiler interprets the above as trying to execute a static member function, which, of course, GetDC() isn't. If I just use:
GetDC();
I get the API GetDC() that expects there to be a m_hWnd, which there isn't (windowless control), so I am pretty lost as to how to do this.
Thanks,
Doug
Doug Knudson
|
|
|
|
|
There is no GetDC method on the IOleInPlaceObjectWindowless interface, nor any of its base interfaces.
You should generally be doing all your drawing in your implementation of IViewObject::Draw , i.e. in OnDraw .
If you need to do some drawing outside of this, the GetDC call is on IOleInPlaceSiteWindowless, which you have to ask the container for. I believe you should call InternalGetSite (which is inherited from CComControlBase ) to retrieve a pointer to this interface.
"Multithreading is just one damn thing after, before, or simultaneous with another." - Andrei Alexandrescu
|
|
|
|
|
Hi Mike,
Thanks! I will give that a try. I am doing the bulk of my drawing in OnDraw() but I need to drag a selection rectangle during the MouseDown, MouseMove, MouseUp events so I need to (or at least I think I need to ) have the DC outside of what is handed to me in OnDraw() ??
Thanks again,
Doug
Doug Knudson
|
|
|
|
|
I am trying to access a .net dll from excel via VBA. I am able to successfully do that on my machine.
But when I try to do the same on user's machine(which does not have VS 2003 but has .net Framework 1.1) The excel (as soon as I open the excel file) gives me an error "File or assembly name QueryData, or one of its dependencies, was not found".
I follow the following steps on the user's machine:
1. Register the .net dll using regasm tool and create a .tlb file
Regasm QueryData.dll /tlb:QueryData.tlb
2. Add this tlb file to the references of the excel.
3. Close the excel sheet and open it again (I have some code in the workbook_open event of excel).
I don't get any errors while generating the tlb file, but as soon as I open the excel I get the error mentioned above. I have also copied all the dlls from the bin folder of my dev machine to the folder (having QueryData.dll) on the user machine.
I have no clue why the excel file is not able to find the dll. Any pointers??
Thanks,
Neeraj
|
|
|
|
|
How to convert interface object to its class?
I have an interface object say IMarkSet. I passed to an COM function. There i need to access a function which takes CMarkedSet .
Thanks
Mohan
|
|
|
|
|
AnanyaMohan wrote: I have an interface object say IMarkSet. I passed to an COM function. There i need to access a function which takes CMarkedSet .
^
|
v
How to convert interface object to its class?
The answer is really simple: you don't.
The reason may be a bit more complicated....
This is a design flaw either in your class or the interfaces it exposes and perhaps even a combination. This is all about abstraction and encapsulation.
A COM object/server exposes several interfaces that can be used to alter the behaviour and/or state of the server. Whatever the server is supposed to do, it must be possible to trigger it through the interfaces. Perhaps you need to query for another interface, or even implement an additional interface, but that's all right; it's supposed to work that way.
But how the server accomplishes its task is entirely up to the server and is encapsulated behind interfaces.
In short: you have to re-evaluate your design.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
AnanyaMohan wrote: There i need to access a function which takes CMarkedSet
That simply is wrong thing, you are trying to do. Always talk through interface.
|
|
|
|
|
Hi,
Iam using a c++ dll in my .net application.It is running fine on the system where visual studio 2005 is installled.
In the deployment environment we have only framework2.0 installed on the machine.Then Iam getting a pop-up error as
"<big><b>Microsoft visual c++ runtime library
Runtime error
c:\testapp\bin\debug\test.exe
The application has requested the application to terminate in the unusual way
Please contact the application's support team for more information</b></big>"
Please kindly help ASAP
|
|
|
|
|
One thing you can look at to troubleshoot this issue...use depends.exe to see what dependencies you have in your dll. If you suspect it might be the framework, perhaps look at the runtime libraries like MSVCR80.dll to see what versions are on your dev system vs your deployment system.
Also, you didn't really provide much information, so I'm not sure if anyone can really provide much feedback.
|
|
|
|
|
My application working fine in the dev environment.But in the testing /production environment
it is not working because that environment has only
windows server 2003
IIS
.net2.0 framework
In my application I have Used some microsoft VC++ dll's also along with .net dll's.
Now Iam getting "RUNTime Error" pop-up screen message as below
" The Application has been terminated in an Unusual Way"
On googling i came to know that some dll's like msvcrt.dll of windows server 2003 has to be changed...But Iam not pretty sure about it..
In Production/test environment there is only framework installed ,but there is no visual studio installed on it.may be due that this error may occur...
So kindly post your suggestions and views to help me
I tried the following as suggested by you:
1. I have installled the redistributable package suggested by you.
after installing i restarted the PC even now also I got the same runtime pop-up error.
2. Then I checked even with the dependency walker for the dll.
I found that there is no miising dll.
3. Then I tried by installing Visual C++ express edition..even then also i got the same pop-up error.
Kindly help me.....
|
|
|
|
|
Hello there,
I've made ActiveX control which is used in my webpage to get client's system information.
I followed the article http://www.codeproject.com/KB/COM/CompleteActiveX.aspx[^] to create and sign the control.
In short I followed this steps:
1. the control is created and is marked as safe
2. The control is packaged into the cab file
3. The cab file is signed by class3 digital certificate issued by Thawte
4. The control is now embedded into the web-page.
The command used for creating cab file and signing it are
c:\cabsdk\bin\cabarc -s 6144 N SystemCheck.cab SystemCheck.ocx SystemCheck.inf
signcode -n "SystemCheck" -i http:
Now when I run the control it runs from most of the machines but from some machines it gives "Unknown publisher" Error.
The page is hosted online and is available at http://92.61.60.4/vod/SystemCheck1.htm[^]
Please note that it doesn't give unknown publisher error on all machines.
Thanks in advance...
|
|
|
|
|
Well, I have a question about the usuage of CComPtr, but I think I know the answer, but would like to make sure I understand this completely...
CComPtr is a smart pointer class for managing COM interface pointers, thus I don't need to worry about calling AddRef for Release methods, since they are automatically called. From what I've read, the Release method will be called when the CComPtr goes out of scope.
I'm have the task of maintaining a COM client app (first time with COM) and I was thinking about 'reusing' a particular instance of a CComPtr (no need to declare a new one, since there's one already!) The only thing that had me worried what that by reusing the CComPtr does that screw up the reference counting and create a memory leak... psuedocode below:
{
CComPtr<isomething> myIsomething = (some Isomething interface)
...do stuff to the CComPtr...
...lets reuse it...
myIsomething = (some other Isomething interface)
}
Since the myIsomething didn't go out of scope when I set "myIsomething" to another interface, I was worried that it may be an issue. So after a day of digging around this is my conclusion:
This is actually OK, since if we look at the definition of this template, the = operator is overloaded as such:
T* operator=(T* lp) {
return (T*)AtlComPtrAssign((IUnknown**)&p, lp);
}
When I looked up AtlComPtrAssign, it seems that it will call release on the interface pointer, prior to reassignment to the new interface. If that's true, there shouldn't be any issues with reference counting and I can continue on my merry way?
|
|
|
|
|
Hello alchong,
>>...lets reuse it...
>>myIsomething = (some other Isomething interface)
Yes, this is OK AFAIK. One reusage problem that I have encountered before is related to QueryInterface().
If you were to do this :
ISomething -> QueryInterface(IID_ISomething, (void**)&myIsomething);
you will get an assertion failure if myIsomething is already holding onto another interface pointer.
You can overcome reusage problems by first assigning myIsomething to NULL as in :
myIsomething = NULL;
before reusing it.
- Bio.
|
|
|
|
|
I see, by assigning it to NULL, that forces the release on the currently held interface, correct? Thanks for the extra tip!
|
|
|
|
|
Hello, i'm created installation project and during installing process i need to config Component Services -> Computers- >My Computer->Dcom Config security properties.
In particular...Security - >Launch Permission : Add ASPNET user and give him rights to Activation/Launch.
I'm know how to do this manually, but how do this on programly on C#?
Thank's and sorry for my english.)))
|
|
|
|
|
I have a VC++ generated COM executable that I wish to launch under a different user to the launching process, i.e. the interactive user.
I have found that this can normally be set in DCOMCNFG, under the identity tab of the properties for the particular application.
All other programs listed in DCOMCNFG have an application type of ‘local server’ and display the ‘Identity’ tab but my program has an ‘application type’ of ‘Remote server’ and the properties of my program do not include this tab.
I have tried adding the 'RunAs' registry entry manually to no effect.
Can anyone tell me why my program is listed as a ‘remote server’ rather than a ‘local server', or what else I should be doing.
Inside the program uses the wizard generated code:
_AtlModule.RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE)
_AtlModule.RegisterServer(TRUE)
Thanks
Steve.
|
|
|
|