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

samfromcn

@samfromcn
About
Posts
41
Topics
20
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to make Edit control show text from right top to left down?
    S samfromcn

    I hope to implement the function like mspaint.exe' s text input. Mspaint has a font toobar, if check the last button on the bar, you can type text from right top to left down.

    C / C++ / MFC tutorial question

  • How to make Edit control show text from right top to left down?
    S samfromcn

    Normally it is ABCD EFGH IJKL MNOP QRST UVWX YZ while I want is : Y U Q M I E A Z V R N J F B W S O K G C X T P L H D

    C / C++ / MFC tutorial question

  • error C4772: #import referenced a type from a missing type library
    S samfromcn

    Thanks for your suggestion, but it does not work. Because I have not write code using I2, if I comment the import clause, project A can be compiled well. But if I add import clause, compiled with error C4772.

    COM help com tutorial question

  • error C4772: #import referenced a type from a missing type library
    S samfromcn

    I have an interface, I1 declared in library A, another interface I2 in library B. I2 has a property whose type is I1. Now I want to use I2 in project A, so I "#import 'B.tlb' rename_namespace('B'), named_guids", then compile failed with error C4772, for interface I1 that in B.tlh can not be indentified. How to resolve this problem?

    COM help com tutorial question

  • how to use an interface belong to another library in idl file
    S samfromcn

    Is there any other way to use I1 in B.idl except import? ;P What I really wonder is how to build a software structure like MS Office. In Office, the _CommandBars is in mso.dll, WinWord.Application is in WinWord.EXE, when I import MSWORD.OLB I can find there is code like "virtual HRESULT __stdcall get_CommandBars ( /*[out,retval]*/ struct Office::_CommandBars * * prop ) = 0;" in msword.tlh. How it happens?!! In my projects, I import B.tlb, there is only "virtual HRESULT __stdcall get_I1 ( /*[out,retval]*/ struct I1 * * prop ) = 0;", while I am looking for "virtual HRESULT __stdcall get_I1 ( /*[out,retval]*/ struct A::I1 * * prop ) = 0;"

    modified on Saturday, September 26, 2009 11:36 PM

    COM help com tutorial question

  • how to use an interface belong to another library in idl file
    S samfromcn

    I have an interface, I1 declared in library A, I use I1 in library B by writing code like ///////////////// begin ///////////////////// import "A.idl" [ object, uuid(...), ...... ] interface I2 : IDispatch{ [propget, id(1), helpstring("...")] HRESULT I1([out, retval] I1** prop); }; ///////////////// end /////////////////// Both project A and project B built all right. Now I import A.tlb and B.tlb in project C, and write following code ///////////////// begin ///////////////////// CComPtr < I1> spI1; ///////////////// end /////////////////// compil failed with message error C2872 : "I1" : ambiguous symbol . While what I hope is only one I1, but now there are two. How to resolve this problem?

    COM help com tutorial question

  • How to transfer a custom struct pointer to DLL's function?
    S samfromcn

    Thank you very much. All questions are resolved. :laugh: :rose:

    C# question csharp c++ data-structures help

  • How to transfer a custom struct pointer to DLL's function?
    S samfromcn

    I has a C++ DLL, it has follow code: typedef struct _SC_CONTEXT{ long hPort; long dwCardType; // BYTE params[24]; } SC_CONTEXT; extern int __stdcall TestFunc(SC_CONTEXT* p) { char buf[256]; sprintf(buf, "hPort is : %d, dwCardType is : %d.", p.hPort, p.dwCardType); // sprintf(buf, "hPort is : %d, dwCardType is : %d, params[0] is : %d.", p->hPort, p->dwCardType, p->params[0]); MessageBoxA(NULL, buf, "caption1", MB_OK); return 0; } I wrote C# code like : [StructLayout(LayoutKind.Sequential)] public struct _SC_CONTEXT { public long hPort; public long dwCardType; } namespace MyName { class MyClass { [DllImport("testDll.dll")] public static extern int TestFunc(ref _SC_CONTEXT11 a); } static void Main(string[] args) { unsafe { _SC_CONTEXT a;// = new _SC_CONTEXT(); a.hPort = 67; a.dwCardType = 66; // a.paras[0] = 255; TestFunc(ref a); } ...... } } the question is, function TestFunc can not get _SC_CONTEXT::dwCardType's value. In the messagebox, content always is "hPort is : 67, dwCardType is : 0.". I want to know why, and how to correct this bug. As you see, I comment an array member of the struct, if not comment it, how to use struct with array member.:confused:

    C# question csharp c++ data-structures help

  • How to make ActiveX Control Redraw in a work thread?
    S samfromcn

    Thank Bio, Someone said that FireViewChange interact with the container, then the container tells the control to redraw. It's a little complicated for me. Now I create a hide window in main thread, work thread send user message to the window, the window call control's FireViewChange. This is easy to implement and it works well^_^. :-D

    COM com tutorial question

  • How to make ActiveX Control Redraw in a work thread?
    S samfromcn

    I wrote an ActiveX Control, I hope it can show different picture every 10 seconds. So I start a work thread, it prepairs the picture's data and calls the control's FireViewChange method every 10 seconds. Now it seems like that FireViewChange call does not work because the picture that control shows out won't change until I resize the test web page. My control is apartment thread mode and I call CoInitialize(NULL) in my work thread. What changes should I do to make my control work as I want? Thank you.:confused:

    COM com tutorial question

  • How to use GDI+ in an ActiveX Control? [modified]
    S samfromcn

    I change the system to windows 2003, the problem was resolved.

    ATL / WTL / STL c++ com graphics help tutorial

  • How to use GDI+ in an ActiveX Control? [modified]
    S samfromcn

    I wrote an ActiveX control. At first there was no GDI+ code in it and it worked well. Then I added follow code: class ATL_NO_VTABLE MyControl: public ......... { ... BOOL OpenImageFile(BSTR FilePath) // added a method { USES_CONVERSION; m_pBitmap = Bitmap::FromFile(FilePath); return m_pBitmap!=NULL; } Bitmap *m_pBitmap; // added a point } After I added a point and a method, MyControl was no long created successfully. I searched in www.codeproject.com and finded Ryan Johnston's article----http://www.codeproject.com/KB/GDI-plus/gdipluscontrol.aspx, I read the article and thought it would resolve my problem, en..., it didn't. It's very strange that after I remove my method, MyControl can be created, but if I add "static InitGDIPlus GDI_Plus_Controler;" in MyControl.cpp, MyControl can not be created again. I have not call the object's method yet, only declare a static global. Why this declaration make MyControl create failed? I hope someone can help me resolving this problem. Suggestion, article, code example, anything may be helpful is appreciated, thank you. :confused: My System: Windows 2000 Server, VC6(ATL3.0), Windows Server 2003 SP1 SDK

    modified on Tuesday, March 18, 2008 11:06 AM

    ATL / WTL / STL c++ com graphics help tutorial

  • Is there any way to let a process write some bytes to itself's PE file?
    S samfromcn

    I am writting register part of my software. When user enter the right register code, I want to modify some Bytes in the a.exe file's to remember this. And it means I need write some bytes to the a.exe file when it is running.

    C / C++ / MFC question

  • Is there any way to let a process write some bytes to itself's PE file?
    S samfromcn

    I have a PE file a.exe, I hope that during a.exe is running, it can write some bytes to a.exe's .rdata block. If you have any idea helpful to me, please tell me, thanks a lot.:-O

    C / C++ / MFC question

  • Why can not define _ATL_MIN_CRT in Service Project?
    S samfromcn

    I create a new Windows Service Project. I find there is not _ATL_MIN_CRT in both Unicode Release build configuration. I think it is weird so I added _ATL_MIN_CRT in them. Then building action failed with message "unresolved external symbol _main". why can not define _ATL_MIN_CRT in Win32 Service Project?:doh:

    ATL / WTL / STL question announcement workspace

  • [Message Deleted]
    S samfromcn

    [Message Deleted]

    Database

  • how to format a string without using MFC and CRT?
    S samfromcn

    I build my project with "Win32 Unicode Release MinSize" setting. It defines "_UNICODE", "_ATL_DLL", "_ATL_MIN_CRT". And I don't want my dll to use MFC and CRT. now I need to format strings. I think I should prevent calling functions like "_stprintf" from using CRT. But I don't know other way to fromat strings. Can you tell me some helpful Win32 functions. Or, maybe my idea is wrong!:)

    ATL / WTL / STL c++ tutorial question announcement

  • How to draw the window border by myself ?
    S samfromcn

    When I use Adobe PhotoShop's Crop Tool. It creates a subwindow helping me to select image scope. The subwindow attract me for its frame line looks moving. And I hope that there will be such a window in my application. anyone can help me ?:laugh:

    C / C++ / MFC adobe help tutorial question

  • When use Bitmap::Clone(), I meet a problem.(about GDI+)
    S samfromcn

    Source bitmap is 800*600, and I called Clone(700, 500, 900, 700, PixelFormatDontCare),method failed. After searching in msdn, I know why the call failed. But what I really want is a new bitmap, 200*200, part of it is a copy of the source bitmap, and the other part is white color. How to get such a bitmap? Wish someone give me some ideas.:-O

    C / C++ / MFC graphics winforms algorithms help tutorial

  • how to change pixel size to centimeter size?
    S samfromcn

    I got a 600*480(pixel) picture with my camera. I wonder how many centimeters the width and height are. how to calculate?:confused:

    C / C++ / MFC tutorial 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