Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

picazo

@picazo
About
Posts
57
Topics
29
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How can i detect if a path is valid.
    P picazo

    What do you mean if syntax is incorrect? Can you give an example?

    ----------------- Picazo

    C# question

  • IPC Events in windows service
    P picazo

    Yes. I would like to use the IPC channel since the service and the winform will live on the same machine. I have used IPC before, but never with winservices or events. That is the part that I would like some advice or assistance with. Thanks,

    ----------------- Picazo

    C# tutorial sysadmin

  • IPC Events in windows service
    P picazo

    Hi everyone, I have been researching this topic for a few hours now and have not found any good sources of information. Basically, I have a windows service and a windows form application. The winform app can control the service (start, stop, pause...). However, the service runs long processes, and I would like for it to report progress that can be displayed by the winform, when the winform is running. The progress should be reported by raising events that the winform will subscribe to. I know I will have to have a shared library that contains an interface or class that the server extends or inherits. I am not sure how to the whole thing would be structured though. If anyone has any experience with this and can share a very simple example, I would really appreciate it. Links to related articles are also very welcome. Thanks in advance,

    ----------------- Picazo

    C# tutorial sysadmin

  • WebBrowser control and javascript files
    P picazo

    Hi, Is it possible to link a javascript file to a WebBrowser control's document? For example, if I have a library, whose main js driver file is called myLib.js, is it possible to link to the library from a document loaded in the WebBrowser control? I have tried something like: webBrowser.DocumentText = "" + "" + "" + "Call test func" + ""; where testFunc(...) is a function in my javascript library, but it does not work. Thanks in advance,

    ----------------- Picazo

    C# javascript tutorial question

  • Allow WS to save outside web directory
    P picazo

    Yes, I think you can do that. But I want to be able to save it anywhere (the WS user would specify where to save it).

    ----------------- Genaro

    Web Development sysadmin question

  • Allow WS to save outside web directory
    P picazo

    Hi Fred, thanks a lot for your comments. Everything I've read seems to indicate that it is not possible. One solution that I have come up with (which I don't like) is the following: a) Select a web directory where all the files will be saved b) Prepend the path where the file should be saved as the first line in the file. c) Have a process that polls the directory d) Have the process read the destination path, remove the first line from the file and move the file. While, this works fine, I don't like having the process polling all the time. It would be great if the web service could launch a console app that took care of moving the file and then terminated. However, this results in access problems. Hopefully a better solution will come along soon. Thanks,

    ----------------- Genaro

    Web Development sysadmin question

  • Allow WS to save outside web directory
    P picazo

    Hi all, I have a web service that accepts requests from users. I would like to be able to save the results of those requests to file on the server, outside the web directory. The results will be generated by the web service, so I don't think there is great risk of saving unwanted files. Has anyone done this before, or can anyone suggest possible solutions to doing this? Thanks a lot,

    ----------------- Genaro

    Web Development sysadmin question

  • XSL general question
    P picazo

    Hi, I am new to XSL and I was hoping someone could help me with a problem I am having. I have an Input.xml file to which I want to apply a xsl stylesheet Style.xsl. I also have a Template.xml file which I want to use as the base for the output file. At the moment, here is what I have: I seem to be doing this backwards, here is what I want A

    XML / XSL xml help question lounge

  • Managed stream to unmanaged VARIANT
    P picazo

    Can you give me an example of how you would do this if the stream is to contain well-formatted xml.

    ----------------- Genaro

    Managed C++/CLI question csharp c++ help tutorial

  • Managed stream to unmanaged VARIANT
    P picazo

    Another data type conversion question: Is it possible to pass a c# stream to a C++/CLI wrapper method which in turn converts it to VARIANT type and passes it to an unmanaged C++ method? Here are the two pieces of code that I would like to see working together:

    // C#
    Stream csStream = ...
    managed.ManagedMethod( csStreamVar );
    
    // Unmanaged C++
    UnmanagedClass::UnmanagedMethod( VARIANT unmanStream )
    {
    ...
    }
    

    Can someone help me fill the following C++/CLI wrapper method that converts the stream to VARIANT?

    ManagedClass::ManagedMethod( Stream^ manStream )
    {
       ... How to convert? ...
       unmanaged.UnmanagedMethod( ...???... );
    }
    

    Thanks,

    ----------------- Genaro

    Managed C++/CLI question csharp c++ help tutorial

  • Managed String to Unmanaged VARIANT
    P picazo

    could you provide some sample code of how to do this? I thought of doing that, but I couldn't get it to work. Thanks,

    ----------------- Genaro

    Managed C++/CLI csharp c++ help tutorial question

  • Managed String to Unmanaged VARIANT
    P picazo

    Hello, I have the following unmanaged method:

    BSTR UnmanagedClass::UnmanagedMethod( BSTR x, VARIANT y, BSTR z )
    {
    ...
    }
    

    I am wrapping that method with the following C++/CLI method:

    String^ ManagedClass::ManagedMethod( String^ x, String^ y, String^ z )
    {
       CComBSTR bstrX, bstrZ;
       bstrX.Attach( ( BSTR )( void * )Marshal::StringToBSTR( x ) );
       bstrZ.Attach( ( BSTR )( void * )Marshal::StringToBSTR( z ) );
    
       ????
    
       return gcnew String( unmanaged->UnmanagedMethod( bstrX, ???, bstrZ ) );
    }
    

    The C++/CLI wrapper method will be accessed from C# as follows:

    string x="some value", y="another value", z="a third value";
    managed.ManagedMethod( x, y, z );
    

    The problem I am having is converting the managed string handle (String^ y) to an unmanaged VARIANT parameter. I would like to be able to solve this problem without having to modify the unmanaged C++ code. Does anyone have any suggestions or ideas on how to do this? Thanks in advance,

    ----------------- Genaro

    Managed C++/CLI csharp c++ help tutorial question

  • c++ from c#
    P picazo

    I actually have 2 and 3 combined... both managed and unmanaged c++ in the same dll. I added another managed class to the dll, which just returns the sum of two numbers and does not access any managed code, but I get the same error. Thanks,

    ----------------- Genaro

    C# csharp c++ question

  • c++ from c#
    P picazo

    Hi and thanks for the response. 1) Crashes here means that I get the following: No symbols are loaded for any call stack frame. The source code cannot be displayed. with exception: {"The specified module could not be found. (Exception from HRESULT: 0x8007007E)":null} 2) I added the try/catch, but it never hits it 3) I included a reference to the dll, and it seems to find the class (since intellisense is available). I have wrapped the c++ code with a namespace and am now '#using' it, just in case. Any more ideas? Thanks,

    ----------------- Genaro

    C# csharp c++ question

  • c++ from c#
    P picazo

    Hi, I have an unmanaged C++ class, and a managed c++ wrapper for the class. I then access the managed c++ from c# client. The whole thing compiles fine, but when I run the c# client, it crashes as soon as it hits the line where the managed c++ object is initialized. Here is the code that I am working with:

    // C++ CODE
    
    #include 
    #include 
    #using 
    using namespace System;
    
    
    // from msdn
    class UnManagedClass
    {
    public:
    	LPCWSTR GetPropertyA() { return 0; }
    	void MethodB ( LPCWSTR ) {}
    };
    
    public ref class AdapterNET
    {
    private:
    	UnManagedClass * m_unman;
    
    public:
    	// allocate unmanaged object
    	AdapterNET() : m_unman( new UnManagedClass ) {}
    
    	// deallocate unmanaged object
    	~AdapterNET() { delete m_unman; }
    
    protected:
    	// deallocated unmanaged object in finalizer in case the constructor is never called
    	!AdapterNET() { delete m_unman; }
    
    public:
    	property String ^ get_PropertyA
    	{
    		String ^ get()
    		{
    			return gcnew  String( m_unman->GetPropertyA() );
    		}
    	}
    
    	void MethodB( String ^ aString )
    	{
    		pin_ptr str = PtrToStringChars( aString );
    		m_unman->MethodB( str );
    	}
    };
    
    
    
    // C# CODE
    using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace TestingAdapterNET
    {
    	class AdapterNETDriver
    	{
    		static void Main( string[] args )
    		{
    			AdapterNET _adapterNET = new AdapterNET();  // <-- crashes here
    			string propA = _adapterNET.get_PropertyA;
    			_adapterNET.MethodB( propA );
    		}
    	}
    }
    

    Any ideas? Thanks,

    ----------------- Genaro

    C# csharp c++ question

  • managed c++ from c#
    P picazo

    They are not wrapped in a namespace. Do they have to be?

    ----------------- Genaro

    C# csharp c++ visual-studio help question

  • managed c++ from c#
    P picazo

    Hi, I have added a reference for a managed c++ dll to a c# project. I can view the c++ classes and their methods in the object browser. I can also create an instance of the class objects in c#. However, intellisense does not show the object's methods, and if I try to call them, I get an error about them not being defined. Anyone experienced this in the past? Any suggestions? Thanks,

    ----------------- Genaro

    C# csharp c++ visual-studio help question

  • Csharp Client, C++ COM interface
    P picazo

    Would that be the C# forum or the C++? Thanks,

    ----------------- Genaro

    IT & Infrastructure csharp help question c++ com

  • Csharp Client, C++ COM interface
    P picazo

    Hi, not sure if this is the correct place to post this question... I have a C++ COM interface method: SomeMethod(BSTR inString, IUnknown *inCommand, IUnknown **outResult) { ... IXMLDOMElementPtr inCommandPtr = inCommand; ... } I am trying to call it from a c# client app, but I am not sure what I am supposed to pass in for the second param (inCommand). I tried adding a reference to microsoft.XML v6.0 COM. Then doing the following: ... using MSXML2; ... public void MethodWrapper( string command ) { string dummy = "test string"; MSXML2.IXMLDOMDocument2 inCommand = new MSXML2.DOMDocumentClass(); inCommand.loadXML( command ); _theCOMObj.SomeMethod(dummy, inCommand.documentElement); } ... I am getting the following error: It is an error to mix objects from different versions of MSXML. Does anyone have any clue how to fix this? Any suggestion would be greatly appreciated.

    ----------------- Genaro

    IT & Infrastructure csharp help question c++ com

  • SQL Query help
    P picazo

    Hi, I have tables:

    Fruits:
    FruitID | FruitName

    1 | Apple
    2 | Orange
    3 | Pear

    Baskets:
    Basket | FruitID | Amount

    Bask1 | 1 | 3
    Bask2 | 1 | 5
    Bask3 | 1 | 2
    Bask1 | 1 | 1
    Bask2 | 1 | 2
    Bask1 | 3 | 2
    Bask3 | 3 | 4

    What query can I use to get the following table:

    Basket | Apple | Orange| Pear

    Bask1 | 3 | 1 | 2
    Bask2 | 5 | 2 | NULL
    Bask3 | 2 | NULL | 4

    Thanks in advance,

    ----------------- Genaro

    Database database help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups