Search Results

Search found 3559 results on 143 pages for 'winforms interop'.

Page 99/143 | < Previous Page | 95 96 97 98 99 100 101 102 103 104 105 106  | Next Page >

  • How to speed up 'cold start' of .NET component called from VB6 app

    - by Craig Johnston
    I have a VB6 app which brings up a form by invoking a .NET DLL, but the problem is that this form takes almost 5 seconds to appear after a menu item in the VB6 app is selected. How can I speed this up? I'm thinking that one possible solution is to load the Form from the .NET DLL during the splash screen of the VB6 app but make invisible or somehow not show it, and then when the menu item is selected I will make it show or visible. What are my options?

    Read the article

  • Finalizing a COM object

    - by Neverrav
    I'm trying to implement a singleton class, that holds a com object inside it. Class implements IDisposable interface, but when I try to implement a finalization method, I get an exception of access to com object from another thread. This happens because clr uses a different thread when finalizes objects. Is there any way to implement such a thing or maybe I just doing something wrong?

    Read the article

  • Does the COM server have to call SysFreeString() for an [out] parameter?

    - by sharptooth
    We have the following interface: [object, uuid("uuidhere"), dual ] interface IInterface : IDispatch { [id(1), propget] HRESULT CoolProperty( [out, retval] BSTR* result ); } Now there's a minor problem. On one hand the parameter is "out" and so any value can be passed as input, the parameter will become valid only upon the successful return. On the other hand, there's this MSDN article which is linked to from many pages that basically says (the last paragraph) that if any function is passed a BSTR* it must free the string before assigning a new string. That's horrifying. If that article is right it means that all the callers must surely pass valid BSTRs (maybe null BSTRs), otherwise BSTR passed can be leaked. If the caller passed a random value and the callee tries to call SysFreeString() it runs into undefined behavior, so the convention is critical. Then what's the point in the [out] attribute? What will be the difference between the [in, out] and [out] in this situation? Is that article right? Do I need to free the passed BSTR [out] parameter before assigning a new one?

    Read the article

  • What's the right way to communicate between 2 or more .Net applications running on a same computer w

    - by Ivan
    If my applications run on a same computer or even on different computers in a same LAN and need intense and quick communication, it seems illogical for me to use text-encoded web services and HTTP. I could possibly use IP/TCP/UDP sockets and invent my own protocols, but believe there is a standard way for .Net applications to send/receive object instances (and, maybe, even sharing an object by reference?). Can you tell me what's that standard way? I am only interested in .Net Framework 4 applications and don't need to support legacy frameworks.

    Read the article

  • How to Use .NET Assembly from Legacy SQL Server 2000 DTS

    - by shyneman
    Hi All, I have a .NET assembly that needs to be called from a DTS package. There are two options I am considering to get this to work: 1) write a COM-callable wrapper for the .NET assembly and have the VBScript create the COM object to use 2) write a .NET command-line exe that uses that .NET assembly and have the VBScript execute that exe Can anybody comment on the pros/cons of either approach and which is the better way of doing this? If there are other solutions, I'd love to hear them too. Thanks a lot for any input.

    Read the article

  • Question about making Asynchronous call in C# (WPF) to COM object

    - by Andrew
    Hi, Sorry to ask such a basic question but I seem to have a brain freeze on this one! I'm calling a COM (ATL) object from my WPF project. The COM method might take a long time to complete. I thought I'd try and call it asychronously. I have a few demo lines that show the problem. private void checkBox1_Checked(object sender, RoutedEventArgs e) { //DoSomeWork(); AsyncDoWork caller = new AsyncDoWork(DoSomeWork); IAsyncResult result = caller.BeginInvoke(null, null); } private delegate void AsyncDoWork(); private void DoSomeWork() { _Server.DoWork(); } The ATL method DoWork is very exciting. It is: STDMETHODIMP CSimpleObject::DoWork(void) { Sleep(5000); return S_OK; } I had expectations that running this way would result in the checkbox being checked right away (instead of in 5 seconds) and me being able to move the WPF gui around the screen. I can't - for 5 seconds. What am I doing wrong? I'm sure it's something pretty simple. Delegate signature wrong? Thanks.

    Read the article

  • Select Range by string

    - by Petott
    How I can change this feature so I select the range of characters in a word document between the characters "E" and "F", if I have; xasdasdEcdscasdcFvfvsdfv is underlined to me the range - cdscasdc private void Rango() { Word.Range rng; Word.Document document = this.Application.ActiveDocument; object startLocation = "E"; object endLocation = "F"; // Supply a Start and End value for the Range. rng = document.Range(ref startLocation, ref endLocation); // Select the Range. rng.Select(); } This function will not let me pass by reference two objects of string type....... Thanks

    Read the article

  • Extract a C/C++ header file from a C# class exposed to COM

    - by isorfir
    I'm not sure I've setup everything I've needed to in my C# class to properly, but it does work in COM. I've been looking for an example of a C# class that was successfully used in a C/C++ project, but haven't come across anything. I've tried using the OLE/COM Object View app to open the .tlb file and save as .h, but it gives some errors: MIDL1009: unknown argument ignored; MIDL1001: cannot open input file Studio "Studio" isn't the name of the file, it's Syslog, so that raises a red flag to me. Any ideas?

    Read the article

  • Call an haskell function in .net

    - by SuperBloup
    Hi, I want to use an Haskell function with the following type :: string -> string from a C# programm. I want to use hs-dotnet to bridge both worlds, the author claim that it's possible, but provide no sample of this case. The only samples provided are the one to use .net from haskell. Does anyone got a sample of this use, or got an idea how to use it? (I used reflector on the bridging assembly but didn't understood a thing)

    Read the article

  • .Net C#: support differnt Office versions

    - by Chris
    We created an application that uses Office 2007 (Excel 2007) to read in data from an Excel worksheet. However. I noticed that when I want to deploy the application on a system with Office 2003 installed, it crashes because other PIA's (and other dll's) need to be referenced for this version of office. Do I need to compile different versions of my application to be able to support different versions of Office or is there a more ellegant solution for this problem? I use Visual Studio 2010 (C#) and the .Net 4.0 platform. Many thanks Chris

    Read the article

  • How can I see which shared folders my program has access to?

    - by Kasper Hansen
    My program needs to read and write to folders on other machines that might be in another domain. So I used the System.Runtime.InteropServices to add shared folders. This worked fine when it was hard coded in the main menu of my windows service. But since then something went wrong and I don't know if it is a coding error or configuration error. What is the scope of a shared folder? If a thread in my program adds a shared folder, can the entire local machine see it? Is there a way to view what shared folders has been added? Or is there a way to see when a folder is added? [DllImport("NetApi32.dll", SetLastError = true, CharSet = CharSet.Unicode)] internal static extern System.UInt32 NetUseAdd(string UncServerName, int Level, ref USE_INFO_2 Buf, out uint ParmError); [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] internal struct USE_INFO_2 { internal LPWSTR ui2_local; internal LPWSTR ui2_remote; internal LPWSTR ui2_password; internal DWORD ui2_status; internal DWORD ui2_asg_type; internal DWORD ui2_refcount; internal DWORD ui2_usecount; internal LPWSTR ui2_username; internal LPWSTR ui2_domainname; } private void AddSharedFolder(string name, string domain, string username, string password) { if (name == null || domain == null || username == null || password == null) return; USE_INFO_2 useInfo = new USE_INFO_2(); useInfo.ui2_remote = name; useInfo.ui2_password = password; useInfo.ui2_asg_type = 0; //disk drive useInfo.ui2_usecount = 1; useInfo.ui2_username = username; useInfo.ui2_domainname = domain; uint paramErrorIndex; uint returnCode = NetUseAdd(String.Empty, 2, ref useInfo, out paramErrorIndex); if (returnCode != 0) { throw new Win32Exception((int)returnCode); } }

    Read the article

  • C++/CLI Mixed Mode DLL Creation

    - by Adam Haile
    I've got a native C++ DLL that I would like to have a C++/CLI wrapper layer for. From what I understood, if you simple added a C++/CLI class to the project, VS would compile as mixed mode, but I was apparently wrong as VS doesn't seem to be even touching the managed code. So, given a pre-existing native code-base what exactly, step-by-step, do you need to do to create a mixed mode DLL, so that I can can link into that code from any .NET language? *I need to do this because my native code uses C++ classes that I cannot P/Invoke into.

    Read the article

  • How to easily pass a very long string to a worker process under Windows?

    - by sharptooth
    My native C++ Win32 program spawns a worker process and needs to pass a huge configuration string to it. Currently it just passes the string as a command line to CreateProcess(). The problem is the string is getting longer and now it doesn't fit into the 32K characters limitation imposed by Windows. Of course I could do something like complicating the worker process start - I use the RPC server in it anyway and I could introduce an RPC request for passing the configuration string, but this will require a lot of changes and make the solution not so reliable. Saving the data into a file for passing is also not very elegant - the file could be left on the filesystem and become garbage. What other simple ways are there for passing long strings to a worker process started by my program on Windows?

    Read the article

  • C++ Problems with #import of .NET out-of-proc server.

    - by jm
    In C++ program, I am trying to #import TLB of .NET out of proc server. I get errors like: z:\server.tlh(111) : error C2146: syntax error : missing ';' before identifier 'GetType' z:\server.tlh(111) : error C2501: 'TypePtr' : missing storage-class or type specifiers z:\server.tli(74) : error C2143: syntax error : missing ';' before 'tag::id' z:\server.tli(74) : error C2433: 'TypePtr' : 'inline' not permitted on data declarations z:\server.tli(74) : error C2501: '_TypePtr' : missing storage-class or type specifiers z:\server.tli(74) : fatal error C1004: unexpected end of file found The TLH looks like: ... _bstr_t GetToString ( ); VARIANT_BOOL Equals ( const _variant_t & obj ); long GetHashCode ( ); _TypePtr GetType ( ); long Open ( ); ... I am not really interested in the having the base object .NET object methods like GetType(), Equals(), etc. But GetType() seems to be causing problems. Some google research indicates I could #import MSCORLIB.TLB (or put it in path), but I can't get that to compile either. Any tips?

    Read the article

  • How to call functions inside a C dll which take pointers as arguments from C#

    - by AndrejaKo
    Hi people, this is my first post here! I'm trying to make a windows forms program using C# which will use a precompiled C library. It will access a smart card and provide output from it. For the library, I have a .dll, .lib and .h and no source. In the .h file there are several structs defined. Most interesting functions of the .dll expect pointers to allocated structs as arguments. I've been calling functions inside the .dll like this: For example function EID_API int WINAPI EidStartup(int nApiVersion); would be called like this [DllImport("CelikApi.dll")]//the name of the .dll public static extern int EidStartup(int nApiVersion); Now my problem is that I can't find equivalent of C's pointers which point to dynamically allocated structures in memory in C#, so I don't know what to pass as argument to functions which take C pointers. I don't have much experience in C#, but to me its use looked as the easiest way of making the program I need. I tried with C++, but Visual Studio 2010 doesn't have IntelliSense for C++/CLR. If you can point me to something better, feel free to do so.

    Read the article

  • Recurrance Calendar Issue in Lotus Notes

    - by Preeti
    Hi all, I am creating a Daily Reccurrance pattern in calendar items. But there is a issue as before clicking "save and Send Invitations" button, but in the Document Properties field i am able to view the RepeatForUnit and based on its value i am identifying the Reccurrance type like (D: for daily, W: for Weekly, M: for montlhy etc). But, After clicking on the "save and Send Invitations" button, the Recurrance is getting saved but after that, i am unable to get the RepeatForUnit field in Document Properties. Kindly help me, how to identify the Reccurrance type and the related fields. Note: I am using Domino.dll using C#. Regards, Preeti

    Read the article

  • How to detect if a doc document password protected

    - by StuffHappens
    Hello. I have a folder with lots of doc-documents and I need to upload their context into database. The problem is that some of them are password protected and I don't know the password. I would like to skip them but I don't know how to detect if password protection presents. If someone helps I'll appriciate it greatly. P.S. Programming language is C#.

    Read the article

  • Thread local storage with __declspec(thread) fails in C++/CLI

    - by EFrank
    I'm working on a project where we mix .NET code and native C++ code via a C++/CLI layer. In this solution I want to use Thread Local Storage via the __declspec(thread) declaration: __declspec(thread) int lastId = 0; However, at the first access of the variable, I get a NullReferenceException. To be more precise, the declaration is done within a ref class (a .NET class implemented in C++/CLI). I have already read something about __declspec(thread) does not work with delay loaded DLLs. Am I using delay loaded DLLs automatically if I use .NET?

    Read the article

  • Using C# assemblies from VB6 code. Some issues.

    - by AngryHacker
    I have a C# assembly, which is regasmed, but is not in the GAC. In my VB6 code, I added a reference to the generated type library (the .tlb file). Then I instantiate the C# lib in my VB6 code. If I run it from the VB6 IDE, it does not work. The Set in the code below: Dim obj as MyCSharpNamespace.MyCSharpObject Set obj = New MyCSharpNamespace.MyCSharpObject causes this error: Automation error The system cannot find the file specified However, if I compile the VB6 project to an EXE and run it, it runs perfectly fine. I should add that all the VB6 project files (e.g. forms, modules, etc...) are in the same folder as the C# DLL and TLB. So why can't I run it from the IDE environment?

    Read the article

  • Adding reference to Office library failing: type or namespace name Word not found

    - by Dave
    I'm trying to use the sample code here: I went to "Add Reference" dialog and added "Microsoft Word 12 library", but it doesn't appear in the Solution Explorer. I also added: using Microsoft.Office; I get the following error message when trying to declare a "Word" object. Error 1: The type or namespace name 'Word' could not be found (are you missing a using directive or an assembly reference?) Any suggestions on how to properly reference the Word library?

    Read the article

< Previous Page | 95 96 97 98 99 100 101 102 103 104 105 106  | Next Page >