|
Hello!
My name is Alla. I'w working as a programmer in New Hampshire. I've just started doing Word and Powerpoint Automation (never done before Office Automation). The application I'm working on now creates document-packages,containing one or more Word documents and export these documents to particular locations.
I created Word Application Instance only once at the beginning, so I use this Instance for all documents that I'm going to create for exporting. Everything was fine so far, but when I'm trying to export a huge amount of documents,the following error appears - RPC SERVER UNAVAILABLE and any reference to existing Word Instance throws an error ( it happens when during processing some documents for some reason Range.Paste method throws an exception (RPC server failed)., then I get MS Word warning message and Word trying to recover documents. Immediately after that I get RPC SERVER UNAVAILABLE - means that any access to my Word Instance fails. May be it makes sense to create many Word Application Instances for each document, but we have problem with performance.I tried to send this question to microsoft forums, but nobody responded..Could you, please, help me to solve this problem?
Thank you very much in advance and best regards.
Alla
|
|
|
|
|
Hi,
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
I have prepared a MSI which will automatically install .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
|
|
|
|
|
Hi,
Need help in Synchronizing Execution of Multiple Threads in VC++, i am new to Multithreading Programming.. Any related book or documents will be useful.
Regards,
KDevloper
modified on Saturday, October 4, 2008 12:25 AM
|
|
|
|
|
Hi,
Go through the following article, that will give you some idea about Multithreading programming using Visual Basic.
Article1[^]
Artcle2[^]
Article3[^]
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Thanks John, Am sorry to mention that i need Multithreading programming using Visual c++.
Regards,
KDevloper
|
|
|
|
|
I have already download the sourcecode of Transparent Flash Control
http://www.codeproject.com/KB/COM/flashcontrol.aspx
now I want to draw something on the flash control, I do it like this
OLECONTAINER(void)::Draw(HDC hdcDraw, const RECT *rcDraw, BOOL bErase)
{
HWND hwnd = GetHWND();
HRESULT hr;
RECT r;
IOleObject *lpO = m_lpO;
IViewObject *lpV = m_lpViewObjectEx ? (IViewObject
*)m_lpViewObjectEx : m_lpViewObject;
// if (!m_bTransparent)
{
RECT rTotal;
::GetClientRect(hwnd, &rTotal);
if (lpV)
{
if (!hdcDraw)
{
hdcDraw = ::GetDC(hwnd);
hr = OleDraw(lpV, DVASPECT_CONTENT, hdcDraw, &rTotal);
::ReleaseDC(hwnd, hdcDraw);
}
else
{
hr = OleDraw(lpV, DVASPECT_CONTENT, hdcDraw, &rTotal);
}
}
TextOut(hdcDraw, 0, 0, "test", 4); // <======= do it like this
return;
}
But I find that the text drawn on the hdc will always be covered drawn by flash control
how can I do it?
|
|
|
|
|
Hi all
I have to Create a DLL dynamically in C#. I dont know how Can i Create it dynamicaaly. Can anyone tell me the solution for this.
Thanks in advance
sri
|
|
|
|
|
What aspect of the C++ language makes it easily adapted to COM application
|
|
|
|
|
For VC++'s implementation of C++ : it's the v-table.
- Bio.
|
|
|
|
|
In c++ you got ATL wich is a good way for developing COM objects
JO
|
|
|
|
|
C++ suport Pointer virtual mechanishm(Vtable),that ascpect will more help to develop COM application with efficent resource uses.
|
|
|
|
|
I’m using idl file to create COM Type Library,
Here is the idl:
import "oaidl.idl";
import "ocidl.idl";
[
uuid(71050F79-3FC6-4BCA-BC36-A79465500B71),
version(1.0),
helpstring("MyProj 1.0 Type Library")
]
library MyProjLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
importlib("..\Interfaces\Interfaces.tlb");
[
uuid(83BC908B-C13C-4D6A-B290-C97057ACEBC4),
helpstring("MyClass Class")
]
coclass MyClass
{
[default] interface IMyProjMessage;
};
};
In another project, I call the library with:
#import "..\..\MyProj\MyProj.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
Here’s the error I've got:
fatal error C1084: Cannot read type library file: '..\..\MyProj\MyProj.tlb': Error loading type library/DLL.
I am newer for com & activeX controls – can someone help me?
Many thanks,
S
|
|
|
|
|
Hello Sara123,
Make sure that any dependency TLB(s) (e.g. ..\Interfaces\Interfaces.tlb) is/are either registered, or it/they is/are in a path that is discoverable by the compiler (e.g. in the same directory as MyProj.tlb).
Hope this helps,
- Bio.
|
|
|
|
|
thank you so much of your briefly answer!
S
|
|
|
|
|
Hello Sara123,
No problem. But is your problem solved ? I suggest that your various dependency type libraries be registered. This way, the compiler will be able to refer to them when necessary.
- Bio.
|
|
|
|
|
You need to define your interfaces first with the associated uuid, fore example
import "oaidl.idl";
import "ocidl.idl";
[
object,
uuid(BB137454-1CB9-469b-A398-5BDB535A1920),
dual,
nonextensible,
helpstring("IMyProjMessageInterface"),
pointer_default(unique)
]
interface IMyProjMessage: IDispatch{
[id(1), helpstring("method Foo")] HRESULT Foo();
};
[
uuid(71050F79-3FC6-4BCA-BC36-A79465500B71),
version(1.0),
helpstring("MyProj 1.0 Type Library")
]
library MyProjLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
importlib("..\Interfaces\Interfaces.tlb");
[
uuid(83BC908B-C13C-4D6A-B290-C97057ACEBC4),
helpstring("MyClass Class")
]
coclass MyClass
{
[default] interface IMyProjMessage;
};
};
JO
|
|
|
|
|
oops sorry i didnt saw the importlib("..\Interfaces\Interfaces.tlb"); line, you should assert that MIDL can find the .tlb file
JO
|
|
|
|
|
Hello
Im Having some problems with a ocx file i got from the company im working with...
basically the control is working with winforms,but i dont want to use this control on a win forms, i want to use on a simple console app...
can someone guide me what to do?
this is the only code im using in win forms...
axVCLogAgent1.RecServerIPAddress = "172.20.1.189";
axVCLogAgent1.RecServerPort = 3001;
axVCLogAgent1.VL_connect_rec_server();
axVCLogAgent1.AgentID = UserProperties.AgentId;
axVCLogAgent1.Extension = UserProperties.Extension;
axVCLogAgent1.VL_log_in();
axVCLogAgent1.VL_start_record();
modified on Sunday, September 7, 2008 5:06 AM
|
|
|
|
|
This is an issue with the Threading Model.your ocx might have an ui, which the console cannot display.
if you are sure that does not have any ui, try registering with the COM+ and try to use from your console.
^-^
@|@
- redCat
|
|
|
|
|
Greetings to all,
My goal is to create an assembly that will allow me to print via the web directly from the Windows API, in order to make prints from any type of printer such as matrix (text mode) or others (mostly so graphic).
The problem is that the Internet Explorer (IE) recognizes and accepts the assembly set up. NET 2.0. The problem is knowing where lies the error, Below there's a brief explanation of what I have done:
I have a first project which is a class library of vb in this class is my impression that accesses the api, compiled this class and I have my first assembly. (LinePrinter.dll)
The second project is also a class library, but I have an UserControl in it because I need interaction screen in my constituent assembly to call the PrintDialog, the form has size 0px; 0px because the only thing that interests me is to show the dialog printing to choose the printer to use and then call the printing method, prior to that I refer to the assembled print (LinePrinter.dll). In this class you call PrintX in this class, which is as follows:
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports Microsoft.Win32
Public Interface Printx
Sub texto(ByVal str As String)
End Interface
<comvisible(true)> _
<progid("imprimir")> _
<classinterface(classinterfacetype.autodual)> _
<guid("d6967c5a-22ee-484a-b2d6-9f90f54b85eb")> _
Public Class imprimir
Implements Printx
<comvisible(true)> _
Public Sub texto(ByVal str As String) Implements Printx.texto
If PrintDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Try
Dim ln As LinePrinter.LinePrinter = New LinePrinter.LinePrinter(PrintDialog1.PrinterSettings.PrinterName)
ln.WriteLine(str, True)
ln.EndJob(False)
Catch ex As Exception
MsgBox("Error printin: " + ex.ToString())
End Try
End If
End Sub
End Class
Then I created a signature(.snk) assembly to each project, the snk was created from properties tab of the project "Signing the assembly" and i enable the COM visibility to the UserControl project.
Then compile and create a .CAB file to host both dlls.
HTML is composed this way:
<object id="MiPrintX" name="MiPrintX">
classid="clsid: D6967C5A-22EE-484a-B2D6-9F90F54B85EB" VIEWASTEXT codebase="../scImprX.CAB">
Testing in local network works perfectly if I upload my Web site as a secure site and lowering levels of security; but when a put it in production o a realintranet, I get a message saying that the ActiveX has no name and key safe.
Hope you can help me I'm in a big trouble
Thanks very much
LindaB
|
|
|
|
|
Hello,
Question about software and learning curve to create an addin for Office 2003.
I have an Access database of just words and expressions in two languages. I want to make an addin for Word 2003 that brings up a list of databases in a custom task pane, so that I can choose one and search it for matching terms, then be able to copy one of the results to an open word document. Being able to highlight text in the document and search that from the right-click menu would be nice, but is not necessary.
I really want to do this with freeware, but from posts here I think people usually use VC++ and Visual Basic 6, and they have a good handle on COM. If I purchase anything, including tutorials, it will be out of pocket.
My question is, what variety of software should I choose and, starting from scratch, how may hours would it take to go from zero to beta? This will be an in-house application. My programming experience is with Access VBA, only. Any advice would be appreciated. Cheers.
modified on Sunday, September 7, 2008 8:43 PM
|
|
|
|
|
When you do this kind of project (in any language), you are out of necessity dealing with Library dependencies, regardless of the resultant object structure. And, if you are totally inexperienced, you will find it insanely complicated. Keep in mind that the Office applications are linked to DLLs that are designed for automation and the type of extension or add-in that you describe. However, the existing object model that is implemented in the Office DLLs is by no means trivial or simple.
If you assemble your project within Visual Studio, you have a number of benefits, that as a novice you will find critical to your project's success. Visual Studio is designed for this kind of thing, provides an incredible quantity of documentation, and is optimized for Windows. But, most importantly, it has Intellisense, which can often show you just which interfaces are actually available once you reference the Office DLL.
Also, you might want to check out: Visual Studio Tools for the Office System[^]
|
|
|
|
|
Baltoro,
Hello. I'm very much obliged for your response. It seems clear now that, as a novice, I need a software that will help me. Really, if I tried it without that support, I'd probably spend more time on message boards and asking trivial questions than coding. The standard version of VS 2008 doesn't seem that expensive anymore, and it would be mine when it was all done.
Thanks again. I may also try to access that database with what I think is an asp.net server that is accessible through the research bar in 2003. There was an article about that on CodeProject. But if it ends up as an add-in, I'll just go VS.
Cheers - Hato
|
|
|
|
|
Hato,
With the Office DLLs, you need to understand how the various COM objects control other COM objects (there are hundreds of them); the sequence of function calls is critical. Otherwise, you do alot of coding, but, get just failing return values from your calls. Really, you need the documentation to help you code smoothly. The documentation explains the object model, and how the various COM objects relate to each other. The project is completely impractical without an understanding of how the exported COM objects work. Good luck.
|
|
|
|
|
Hi,
i am a a beginner at this....
my question is that ...From the client pc , how do i call or reference a .dll that sits on the server and get it to execute commands on the server.
sort of like it would do on the client pc.?
thanks in advance
Anoop
|
|
|
|
|