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
S

SujayG

@SujayG
About
Posts
21
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • #imports for MS Office2013
    S SujayG

    Hello Bryan Thanks for sharing the link as well. I commented the import statement, and it worked fine. I have checked the functionality of the classes though. Thanks Sujay

    My Blog

    C / C++ / MFC question announcement

  • #imports for MS Office2013
    S SujayG

    The steps are correct and it worked fine in Office 2000. I had worked on Word automation in C++ / Office 2000 . Yes, I could reproduce the errors. Probably we need to make some changes, for working on C++ / Office. Have a look at [^] ; the steps in which the author makes a change to import. Also check the Word automation using C++ [^] - specially the Solution1.h/cpp and Solution1.h/cpp to view how imports are changed. Let us know if it helps. Sujay

    My Blog

    C / C++ / MFC question announcement

  • DATABASE PROBLEM
    S SujayG

    "

    When I run the debbuger, it show message like this:
    "incompatible data type in criteria expression

    " Exactly in which line does show By the naming convention

    m_tabOnglet

    looks like a member variable of a tabcontrol.

    My Blog

    C / C++ / MFC database help

  • #imports for MS Office2013
    S SujayG

    I think if you generate files from a tlb the paths should automatically come up. This is of Office 2010 #import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL" no_namespace A suggestion : Having developed several Office addins, and if you are also doing so, I shall strongly suggest you to use C# .

    My Blog

    C / C++ / MFC question announcement

  • Passing a C# string to C++/CLI does not show up from a CPP program
    S SujayG

    Thanks for the link. I have created the manged DLL , without errors. I want to call this DLL from native C++ applicaton . Please help me with a step by step process how can I do it .

    My Blog

    Managed C++/CLI c++ help csharp com

  • Passing a C# string to C++/CLI does not show up from a CPP program
    S SujayG

    I want to call a C# function from C++ ; and I am using C++?CLI as the bridge . I had developed a CLI wrapper - for calling C++ function from C# ,but this was my attempt to do the reverse.

    My Blog

    Managed C++/CLI c++ help csharp com

  • Passing a C# string to C++/CLI does not show up from a CPP program
    S SujayG

    What if I dont use String^ and use std::string as the preferred parameter .

    My Blog

    Managed C++/CLI c++ help csharp com

  • Passing a C# string to C++/CLI does not show up from a CPP program
    S SujayG

    Hi , I was following the example at Using managed code in an unmanaged application[^] It seeemed strange that the function signature with String^ throws the error, but std::string does not.

    My Blog

    Managed C++/CLI c++ help csharp com

  • Passing a C# string to C++/CLI does not show up from a CPP program
    S SujayG

    That's just the conversion part . I don't think that's the reason for the string not getting displayed.

    My Blog

    Managed C++/CLI c++ help csharp com

  • Passing a C# string to C++/CLI does not show up from a CPP program
    S SujayG

    Hi There , I want to call a C# function from C++ , via CLI/C++. C# code

    private string _text = "";

    public void setText(string text)
    {
    // _text = text;
    _text = "HI World";
    Console.WriteLine("C# settext - {0}", _text);
    }

    public string getText()
    {
    return _text;
    }

    C++/CLI code Header :

    //virtual void setText(System::String^ text);
    //virtual System::String^ getText();

    virtual void setText(std::string text);
    virtual std::string getText();

    CPP file

    std::string CStringBridge::getText()
    {
    _managedObject = gcnew Bridge();
    return (marshal_asstd::string(_managedObject->getText()));
    }

    void CStringBridge::setText(std::string text)
    {
    _managedObject = gcnew Bridge();
    _managedObject->setText(gcnew System::String(text.c_str()));
    }

    Note : When I use the following code

    virtual void setText(System::String^ text);
    virtual System::String^ getText();

    I get the following error 3395

    __declspec(dllexport) cannot be applied to a function with the __clrcall calling convention

    , and so I stuck to std::string When I use the library from the C++/CLI code, and call from my C++ program, "Hi World" should be printed ; instead nothing gets printed C++ console application

    IStringBridgeWrapper *pBridge = IStringBridgeWrapper::CreateInstance();
    pBridge->setText(std::string("I am here"));

    try{

    pBridge->getText();
    

    }
    catch(exception& e)
    {
    cout << e.what() << endl;
    }

    I think the string is not being properly passed . Any ideas to solve it shall be appreicated.

    My Blog

    Managed C++/CLI c++ help csharp com

  • What is the CLI/C++ equivalent to the C# using statement
    S SujayG

    I think there is a specific keyword in CLI/C++ , which is the equivalent to the using keyword in C#. http://stackoverflow.com/q/338950[^] Can someone please help ?

    My Blog

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

  • MFC and printing
    S SujayG

    Normally for printing the mapping mode is set to MM_TWIPS . Is that the practice you are looking for?

    Blog : http://sujay-ghosh.blogspot.com

    C / C++ / MFC question c++ json help discussion

  • MFC architecture
    S SujayG

    MFC Internals would be too much for him. Right now , he is trying to understand the MFC architecture . ;)

    Blog : http://sujay-ghosh.blogspot.com

    C / C++ / MFC c++ architecture help

  • MFC architecture
    S SujayG

    Hi There , MFC architecture is too big to be discussed on a forum . I would suggest you go through the book of Jeff Prosise, to understand it better .

    Sujay Ghosh Blog : http://sujay-ghosh.blogspot.com

    C / C++ / MFC c++ architecture help

  • Which window has the focus [modified]
    S SujayG

    HI , GetFocus does return me the correct window handle also. I had tried with GetFoucs,GetActiveWindow, none of them are working

    C / C++ / MFC help question

  • Which window has the focus [modified]
    S SujayG

    I have to return the path of the selected file , EITHER in the Desktop or in the Windows Explorer. I can get the path of the selected file both on the Windows Explorer and the desktop My problem is that I am unable to find which window has the current focus 1) The user has selected a file on the desktop 2) The user has selected a file in the Windows explorer. ( So this has the focus now ) How do I programatically find that out I am using the following code HWND hWndDesktop = GetDesktopHandle(); // Gets the handle of the SyslistView32 window DWORD dwThread = ::GetWindowThreadProcessId(hWndDesktop, NULL); GUITHREADINFO gtf ; gtf.cbSize = sizeof(GUITHREADINFO); BOOL b = GetGUIThreadInfo(dwThread, >f); if(hWndDesktop == gtf.hwndFocus) { // this window currently has the focus } But I am getting different handles for hWndDesktop and gtf.hwndFocus . Please let me know if I am missing something EDIT I am trying to get the Window handle across processes . Thanks Sujay

    modified on Friday, December 4, 2009 12:40 AM

    C / C++ / MFC help question

  • How to access the Windows Explorer ( right hand pane ) in Windows 7
    S SujayG

    I want to find out which item has been selected . If it was a SysListview32 , I could have SendMessage and used the HWND of the SyslistView32 . But as it is a DirectUIHWND, I dont see how to get the list view out of that. There is no documentation of DirectUIHWND . One way maybe to get the COM interface, I am thinking of that way. Any help would be appreciated. Thanks, Sujay

    C / C++ / MFC tutorial question

  • How to access the Windows Explorer ( right hand pane ) in Windows 7
    S SujayG

    Hello , I can access the right pane of the Windows Explorer in XP ( 32 bit ) , by getting the handle to the "SysListView32" . But in Windows 7 , the window class for the right hand side of the Windows Explorer is DirectUIHWND. I have used Spy++ to see the child windows, but I only find ControlNotifySink . Any idea how do I get the list view . Thanks in advance Sujay

    C / C++ / MFC tutorial question

  • Getting the dekstop window handle
    S SujayG

    Any idea how can I get the handle to that I guess I need to use FindWindow or FindWinodwEx, but on what. If you can help me with the code or at least the logic, I can try

    C / C++ / MFC question

  • Getting the dekstop window handle
    S SujayG

    Hello Ian, Yes the name is a bit confusing. The desktop handle is the main WIndow on top of which all Windows are painted . But it does not return the handle of the Window ( SysListView32 ) - which is the WIndows desktop . This can be checked with Spy++ There is another function, GetShellWindow, which "probably" returns the Windows desktop handle, I am testing that Sujay

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

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