|
There is an excellent article right here at Code Project that describes clearly and in detail the registry settings that a COM component must make on the host machine: COM IDs & Registry Keys in a Nutshell[^]. Also, you can use the search capability in the Registry Editor, by supplying the GUID in its canonical form, which looks like this: {60B4140E-B0A7-4540-B744-7E1A944E8C78}
(your GUID will be a different number, of course)
This is a 128-bit unique number expressed in hexadecimal. Look in the registry key: HKEY_CLASSES_ROOT\CLSID\...for a long list of all the registered COM CoClasses available on your computer.
What I meant by overhead was the time it actually takes to execute certain instructions or a series of instructions on a computer. This is significant since it places serious restrictions on the overall performance of the software. Assembly programmers test their algorithms all the time in their quest for speed, or, what they would call 'optimization'. Typically the time it takes to execute a function is expressed in clock cycles, based on the rated speed of your processor. Generally, what I'm referring to as 'overhead' are the set up procedures (and security checks) performed by the COM Library, the creation and transmission of the Data Packets exchanged by the Standard Marshaling Architecture (stub and proxy) between your local COM Server and Client Application, and the transmission of the Data via the RPC protocol between your local machine and the remote machine, and the handling of any associated errors.
Debugging these kinds of Networking DCOM problems can be difficult, if not impossible.
|
|
|
|
|
I was googling "RPC DCOM Transmission Acceleration", and I hit this Microsoft Corporation patent description at Patent Storm: Accelerating a Distributed Component Architecture Over a Network Using a Modified RPC Communication[^]. This information is taken directly from the document and describes the 'overhead' better than I did.
"As can be expected, calling an object located on the same computer is faster than calling an object located on a remote computer. This speed difference can be due to a number of factors. The network cables are significantly longer than the leads between the processor and the memory on the local machine. Therefore, the electrical signals simply take longer to reach the remote computer than to reach the object resident in memory on the local machine. A significantly larger factor is the overhead caused by the network protocol. Each data transmission over a network must be encapsulated, and additional information must be added to the packet so that it may be transferred across the network with error correcting capabilities, and so that it may properly be decoded on the remote machine. Furthermore, each packet sent over a network may be accompanied by a flurry of additional network packets performing necessary buffer management and receipt acknowledge functions. These further packets, which comprise the network flow control, also add to the time required to send an object call over a network to a remote computer."
"An additional factor contributing to the speed difference between a call to an object resident on the same machine and one resident on a remote machine is the overhead created by DCOM and the RPC model. RPC marshals pointers and data to be transmitted across the network by reading them from the program memory and packaging them for transportation across the network. Marshaling introduces delay because it copies from program memory into an RPC buffer the element that is to be transmitted across the network. Another aspect of the overhead of DCOM and RPC are the runtime layers. The RPC and DCOM runtime layers bridge together the client and server so that the client can make remote calls to the server. This process of bridging the client and server together is known as binding. Binding information can include the Internet Protocol (IP) address, the port number, and the interface identifier (IID)."
"The combined effects of the marshaling, the additional packets of flow control, and the activities of the runtime layers result in a dramatic decrease in the performance of DCOM over a network. In fact, compared to a raw network application which directly sends data across the network, the DCOM overhead can decrease performance by a factor of three or more."
I'm thinking that there is probably a way to query the rate at which the Data is sent over the the wire in the RPC protocol, but, probably this capability resides in the Remote COM Server. It may not be accessible to your local COM server. Otherwise, I don't really have any suggestions, since I am unfamiliar with the specific COM architecture of your remote server. You could, of course, monitor the performance of your local COM server, establish a baseline for the maximum amount of data that can be accessed, and design accordingly.
A better way would be to design an algorithm that predicts small data fluctuations (based on observed patterns) and, if a cyclic or periodic correlation is evident, eliminate as many redundant data queries as is reasonable, perhaps querying less and less often if your algorithm successfully predicts the outcome of insignificant data fluctuations. I don't know, I'm not really sure what kind of data you receive, or of what significance it is to your analysis.
|
|
|
|
|
Once again, thank you very much for your input. I searched the registry for a while and looked at the properties of the respective COM object, but could not think of any way to change its behaviour in a positive way. I also had a look at the MS patent article, which was very interesting but also confusing I don't think they already implemented this new technique in one of their OS, right?
Anyway, I got an idea how to improve my algo: The DataStream Object offers the ability to remove instruments during runtime. So I can filter instruments out while analyzing. Maybe there are other way too.
At least I have to know now where to improve my application - once again, thank you very much!
|
|
|
|
|
hi all,
How someone can help with this question. I am trying to write a number of tables to Word. I can create the document and application and add a table, my problem arises when I want to seperate them. I believe this is something to do with the "range". The first table is set at range (0, 0), I then try to reset the range, or try to insert some blank lines and reset the range. I have also tried to create a new range for each table but I get the same result everytime which is the new table gets inserted into the first cell.
I have done some serious brain damage reading MS help on ranges and how to reset them and also moving selections up on and down- nothing seem to work. Utimately I have 8 tables and I want one table on 8 seperate pages.
thanks for any help you can give
Imports Microsoft.Office.Interop.Word
Imports System.Runtime.InteropServices
Public junk As New DataTable
Private Sub WriteTables()
Dim oApp As Application
Dim oDoc As Document
'Start a new document in Word
oApp = CType(CreateObject("Word.Application"), Application)
oDoc = oApp.Documents.Add()
' Clear out any existing information.
' oDoc.Range.Delete()
' make the current documents the ActiveDocument
oDoc.Activate()
Dim rng As Range = oDoc.Range(0, 0)
rng.Font.Name = "Verdana"
rng.Font.Size = 16
Dim tlb As Table = oDoc.Tables.Add(Range:=rng, NumRows:= junk.Rows.Count, NumColumns:= junk.Columns.Count)
tlb.Range.Font.Name = "Arial"
tlb.Range.Font.Size = 20
With oApp.Selection
.SetRange(tlb.Range.End + 1, tlb.Range.End + 1)
.Collapse(WdCollapseDirection.wdCollapseEnd)
End With
' Dim i As Integer
' For i = 1 To 5
' oApp.Selection.MoveDown()
' Next
' rng = oApp.Selection.Range
' rng.SetRange(Start:=0, End:=8)
' rng.SetRange(Start:=rng.End + 3, End:=rng.End + 3)
Dim tlb1 As Table = oDoc.Tables.Add(Range:=rng, NumRows:=6, NumColumns:=6)
oApp.Visible = True
End Sub
|
|
|
|
|
This page[^] shows how to add a new table at the end of a word document.
And also try adding a new paragraph for each new table - this VBA code creates a new document with two tables:
Sub Test()
Dim NewDoc As Document
Dim NewTable As Table
Set NewDoc = Application.Documents.Add(, , , True)
Set MyRange = NewDoc.Content
MyRange.Collapse Direction:=wdCollapseEnd
Set NewTable = NewDoc.Tables.Add(Range:=MyRange, NumRows:=6, NumColumns:=10)
NewTable.Borders.OutsideLineStyle = wdLineStyleTriple
NewDoc.Paragraphs.Add
Set MyRange = NewDoc.Content
MyRange.Collapse Direction:=wdCollapseEnd
Set NewTable = NewDoc.Tables.Add(Range:=MyRange, NumRows:=6, NumColumns:=4)
NewTable.Borders.OutsideLineStyle = wdLineStyleTriple
End Sub
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I have a COM dll when i update interface manually my application crashed. but when we update the interface by wizard its working properlly. can any one tell me why this happend and if i want to update any existing interface manually what should i do?
Thanks in Advance
Ashish Chandrakar
|
|
|
|
|
You're clearly doing something wrong when you're manually editing the idl.
The compiler doesn't distinguish between manually added and wizard added code.
chandrakar ashish wrote: can any one tell me why this happend
You will have to post the part which you manually edited.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I think you are missing some thing while updating idl file manually.
Can you please provide some ifo as what you are trying to update. and when is your application crashing.???
|
|
|
|
|
As the other answers have suggested, you're cleaarly doing something when updating the interface manually, so why not update the interface both manually AND by using the wizard, and seeing what the differences are between the IDL generated by the two mechanisms? That should help you realise what you're missing out...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi all,
Thanks a lot for your help in advance.
I am doing a Mail Merging Application. I can get all data from the source (database, file or anything) and using mail Merge fields in Word Document from C# code, I open up the word which is merged with data from database.
MS Word Document Opens –
--- should this be open in IE
--- Or should this be open as ordinary MS Word on Desktop
The problem is if I open it anyway, I loose all control over the Word Document which is opened. I don’t want to do that. I want to keep control over it and allow the Users to update the document with some standard messages which we have in the project. What that means is, the messages will be selected and those messages selected will be put at some point where cursor is kept in the document.
So, when mail merging happens
MS Word Document is opened.
A pop up with standard messages is opened.
User selects the messages he/ she wants to insert into the MS Word Document which is opened.
For these things to happen, I should have control over the MS Word Document which is opened on the client side. Do selection of the messages and populate in Word document (this is my understanding, is there any way to do it easily).
The Issues are:
I need a way to open the MS Word Document in a controlled manner where I can still control the User editing or help user in editing when he / she clicks on my standard messages and wants them to populate on the MS Word Document.
How can I save the MS Word document and make sure that user is not saving it locally and has to upload it again to save it on server.
I Hope I am clear in explaining the situation, please find the attachments which show the MS Word Doc and the popup on side .
|
|
|
|
|
Here is the IDL definition
[
object,
uuid(DAFB7D76-0158-452F-8FD0-FF97A683DEA3),
helpstring("ITest Interface"),
pointer_default(unique)
]
interface ITest : IUnknown
{
[helpstring("method GetString")] HRESULT GetString([out,retval] BSTR* pVal);
};
[
uuid(E768DC15-A19B-407C-ACF9-C420D6FDB1BE),
version(1.0),
helpstring("TestServer 1.0 Type Library")
]
library TESTSERVERLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(788571BD-030B-49CC-8C0A-2DF74E58331A),
helpstring("Test Class")
]
coclass Test
{
[default] interface ITest;
};
};
The ATL COM Library uses APARTMENT threading model.
And the VB.NET windows service code fragment
try
Dim obj As New TESTSERVERLib.Test
Dim s As String
s = obj.GetString()
Catch ex As Exception
WriteToLog(ex.Message)
WriteToLog(ex.InnerException.ToString)
End Try
When the code executes the following error occurs:
Unable to cast COM object of type 'TESTSERVERLib.TestClass' to interface type 'TESTSERVERLib.ITest'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{DAFB7D76-0158-452F-8FD0-FF97A683DEA3}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Object reference not set to an instance of an object.
But the same code works in VB.NET forms application.
Can anyone please explain the reason.
|
|
|
|
|
I am trying to add an extra property page to a device in Windows 7 Devices and Printers. I am following
http://www.microsoft.com/whdc/device/DeviceExperience/DevPrintFolder-Ext.mspx
and
http://msdn.microsoft.com/en-us/library/cc144106(VS.85).aspx
I can add a shortcut item to "right click" menu of the device successfully; however, the extra property page does not show open in device Properties window. If I follow the same steps to add the extra property page to a .test file type, it works and I can see the extra property page shows up. It seems that the COM dll for the property page is fine. Any one successfully completed similar things before?
The following is what I added in Registry:
HKEY_CLASSES_ROOT\CLSID\{Page 1 Property Sheet Handler CLSID GUID}\InProcServer32
(Default) = C:\MyDir\MySheet1.dll
ThreadingModel = Apartment
HKEY_CLASSES_ROOT\DeviceDisplayObject\HardwareId\Device hardware id\shellex\PropertySheetHandlers\MySheet1
(Default) = {Page1 Property Sheet Handler CLSID GUID}
modified 23-Dec-22 21:01pm.
|
|
|
|
|
hello ,
Button on Toolbar not showing chervon effect. When i drag toolbar for chervon then first button is overlapp on all buttons and no image is added into chervon list..So may be problem and which function called when i drag button on toolbar.
Thansks
Am
|
|
|
|
|
maybe one day I could help you to solve the problem.
|
|
|
|
|
Hi Guys,
I have been searching for a SMPP lib for a while now, I finally stumbled on a dll, created by a Romzy, but there wasnt any samples or instructions for implementation, nor have I been able to trace the developer, I have tried using the DLL with little I could gather from the SMPP protocol definition, but in binding to a SMSC, it includes a Sendbindtranceiver with requires (index as short, hsocket as integer, SMPP_PDU_Bind_Transmitter), what I'd like to know is, anyone understand or can suggest what the index might mean or how that data type (short) can be represented and what does hsocket mean.
I do understand that it may be impossible to understand without seeing the code, but I m snatching at straws right now.
Any help or suggestions will be welcome.
|
|
|
|
|
Hi..
You are using a third party com or if you create your own api? Please let me know the detail.
Thanks
Md. Marufuzzaman
|
|
|
|
|
Hi, Thanks for the quick response.
I am using a third party com dll, but cant seem to bind to the smsc.
I will be grateful if you have a Smpp library preferably com, that I can use.
|
|
|
|
|
Well... You have 2 options (a) Create your own api, (b) Use third party api.
let me know that you only send 160 char message or Hex like .. Wap push, logo, mono ring tone etc
you also must get the smsc acknowledgment an Alphanumeric message submit ID right?
Md. Marufuzzaman
|
|
|
|
|
Thanks Marufuzzaman, I am not knowledgeable enough to build my own API, unless I can get a push in the right direction or can get hold of manuals in that regard.
I only need for it to send 160 char. to the receipient, no need for any acknowledgements or response from the receipient, just sending the message(s).
Any idea I can use?
|
|
|
|
|
Hi harrisyn,
So you will use a 3rd party api. Try the following:
http://www.activexperts.com/xmstoolkit/
If you interested to create SMPP api, I think I can help you.
Thanks
Md. Marufuzzaman
Md. Marufuzzaman
|
|
|
|
|
|
Hay..
Definitely my friends, actually last couple of days I'm trying to create an SMPP api, and it almost completed
I will share this with you my friends.
Thanks
Md. Marufuzzaman
|
|
|
|
|
Wonderful news ,
I'd hate to sound like Oliver Twist, but how soon can you complete it
Waiting expectantly
|
|
|
|
|
I will let you know as early as possible....
Md. Marufuzzaman
|
|
|
|
|
|