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
A

Abhishek Srivastava

@Abhishek Srivastava
About
Posts
54
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • avoid loading an already loaded shared library
    A Abhishek Srivastava

    Hi, Details needed ! 1) What problem are you facing if you are again loading the already loaded library.Asd i dont see any issue with that. 2) Are you loading these .dll's explicitly or implicityly i.e.using LoadLibrary or directlinking to it? As in case of explicit linking your process must have the Lib handle to call its function. Regards, Abhishek

    Abhishek Srivastava Technical Lead. India.

    C / C++ / MFC c++ tutorial

  • BSTR from ATL DLL to Client
    A Abhishek Srivastava

    you can use yourMethod([out,retval]BSTR **str); in VB u can use like this string str = yourMethod() Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC c++ design beta-testing question code-review

  • how to write a CString object into a file?
    A Abhishek Srivastava

    Try to write like this! CFile myFile('test.dat', CFile::modeWrite); CString buff; buff = "This is some text"; myFile.Write(str.operator LPCTSTR(),buff.GetLength()); :) Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC help tutorial question

  • overloading operator() in c++
    A Abhishek Srivastava

    for that purpose overload your () operator like this // overloading () operator int operator()() { return value; } now u can access that bracket operator like a1() i hope ur prob is solved now :) regards Abhishek Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC help c++ question

  • Screen Capturing and saving in .AVI
    A Abhishek Srivastava

    for capturing screen imgae use GetDesktopWindow() this will return u the handle of desktop window then using you can get the DC of your desktop like this HWND Desktophwnd = GetDesktopWindow(); CWnd wnd; wnd.Attach(Desktophwnd) ; then query for desktop DC CDC desktopDC = wnd.GetDC(); now using bitmap funtions of CDC class u can actually get the screen bitmap and then for saving it into AVi u have to create Video stream and can save easily ur images in AVI file // for creating AVI u can use library vfw32.lib using AVI function of this libray you can create ur own AVI file by writing AUDIO/VIDEO data in it. like 0 AVIFileInit // for initializing AVI library 1 AVIFileOpen // for creating AVI File 2 AVIStreamCreate / for creating Audio/ video stream 3 AVIStreamWrite //for writing audio video data 5 AVIFileClose // for closing ur file 4 AVIFileExit / un initializing the library For capturing every movement and action taking place on desktop u have to write ur whole image capturing code and saving code in a worker thread. Regards :) Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC c++ tutorial

  • overloading operator() in c++
    A Abhishek Srivastava

    yeah there is one idea ... try this cout<<"value:"<< a1.operator int()<< endl ; > in place of ur line cout << "value:" << a1() << endl; :) actually u have overloaded int() operator :) Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC help c++ question

  • problem with __uuidof
    A Abhishek Srivastava

    can u write those lines of code whih u r using to get __uuidof ur event interface. Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    COM help com

  • Threads..
    A Abhishek Srivastava

    you can set priority of ur thread so that they dont run so quickly using API SetThreadPriority() Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC help question

  • AVI buffers
    A Abhishek Srivastava

    >Does someone knows how the buffers of an AVI file are written in the file ? please make clear , what do u mean by buffers of an AVI file are written in a file r u trying to read an AVI file , writing its data in some other file. or if u mean how to write AVI file? if the case is later the there is a library available Vfw32.lib. using AVI function of this libray you can create ur own AVI file by writing AUDIO/VIDEO data in it. like 0 AVIFileInit // for initializing AVI library 1 AVIFileOpen // for creating AVI File 2 AVIStreamCreate / for creating Audio/ video stream 3 AVIStreamWrite //for writing audio video data 5 AVIFileClose // for closing ur file 4 AVIFileExit / un initializing the library Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC question

  • worker thread communicate with user interface
    A Abhishek Srivastava

    Hi, Have u tried PostThreadMessage() API , using this API u can post ur event message to ur worket thread. for e.g void yourFunction() { BOOL success = PostThreadMessage( idThread, your thread ID Msg, // message wParam, // first message parameter lParam // second message parameter ); } and in your Thread... DWORD WINAPI yourThreadProc(void *ptr) { MESSAGE msg; while(GetMessage(&msg,NULL, 0,0) { switch(msg.message) { ---do your work accordingly --- } } } Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC csharp design help tutorial question

  • How to get a https file
    A Abhishek Srivastava

    Hi , i have also done the same thing once but using Wininet APIS i can guide u how to use them. To use the HTTP WinInet functions Call the InternetOpen function to initialize an Internet handle. InternetOpen creates the root HINTERNET handle used to establish the HTTP session. The HINTERNET is used by all subsequent functions. Call InternetConnect using the HINTERNET returned by InternetOpen to create an HTTP session. When calling InternetConnect, specify INTERNET_DEFAULT_HTTP for the nServerPort parameter and INTERNET_SERVICE_HTTP for the dwService parameter. InternetConnect uses the handle returned by InternetOpen to create a specific HTTP session. InternetConnect initializes an HTTP session for the specified site, using the arguments passed to it and creates HINTERNET that is a branch off the root handle. InternetConnect does not attempt to access or establish a connection to the specified site. Call HttpOpenRequest to open an HTTP request handle. HttpOpenRequest uses the handle created by InternetConnect to establish a connection to the specified site. Call HttpSendRequest using the handle created by the HttpOpenRequest to send an HTTP request to the HTTP server. Call InternetReadFile to download data. –Or– Call InternetQueryDataAvailable to query how much data is available to be read by a subsequent call to InternetReadFile. Call InternetCloseHandle to close the handle created by HttpOpenRequest. Call InternetCloseHandle to close the HTTP session created by InternetConnect. Call InternetCloseHandle to close the handle created by InternetOpen. in this way u can download ur file :) Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC tutorial sysadmin help question

  • COM errors
    A Abhishek Srivastava

    Hi Mr Prakash! actually yes, u dont need to make one more #define as one already exist there /**** MessageId: E_FAIL MessageText: Unspecified error #define E_FAIL _HRESULT_TYPEDEF_(0x80004005L) ***/ so instead of using that not so gud luking figure 0x80004005 u can smiply use better luking "E_FAIL" for this purpose :) I hope ur prob is solved :) Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC com help question

  • help in an active x control
    A Abhishek Srivastava

    Hi there :) Using the API GetAmbientUserMode() , this tells whether the container is in run-mode (TRUE) or design-mode (FALSE). regards Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

    COM design help question

  • Can we create a Search Engine in VC++
    A Abhishek Srivastava

    Hi dear :) Yes search engine can be devloped in VC++ and Not only SEARCH ENGINE , you can even create "RESEARCH ENGINE" in VC++. say cheers for VC++.. :-O Abhishek Srivastava Software Engg (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC c++

  • Passing HWND from a MDI app to a activeX control
    A Abhishek Srivastava

    Hi , Actually HWND data type cannot be used for automation, as it is not supported. so what you can do is simply use long data type, make "HWND hwnd" as "long hwnd" and when u recieve handle in ur activeX object typecast again into HWND Init(LPTSTR lpstrCmdLine, int nCmdShow,long hwnd) { HWND wHandle =(HWND)hwnd; // now you can use this wHandle for your purpose :) ----- ----- } Regards Abhishek Srivastava Software Engg (VC++) India ,Noida Mobile no 9891492921 :)

    COM com help

  • All COM that expose a specific interface
    A Abhishek Srivastava

    hi frnd :) One can search a component installed on a particular machine based on the CATID i.e category ID in which it falls. there are two interfaces ICatInformation using methods of which you can enumerate all the component of a CATID. and ICatRegister interface which provides methods for registering and unregistering component category information in the Registry. have look on these interfaces in your MSDN , u might find your solution. Abhishek Srivastava Software Engg (VC++) India ,Noida Mobile no 9891492921 :)

    COM com question

  • CString to Integer
    A Abhishek Srivastava

    Hi friend ,:) it is as smiple as that CString str="1235678"; int a = atoi(str.operator LPCTSTR()); now try this :) "This world is a compliler, I am compiling my life and trying to make it error free :D" Abhishek Srivastava Software Engg (VC++) India ,Noida Mobile no 9891492921 :)

    C / C++ / MFC tutorial

  • how to send a broadcast message?
    A Abhishek Srivastava

    Hi mr hawk, use this SendMessage(HWND_BROADCAST,yourMsg, yourwParam , yourlParam); but this message should be a registered window message. coz this message should be unique so that every window can process it. you can use RegisterWindowMessage API to create your own unique message. :) Regards. Abhishek Srivastava Software Engg (VC++) India ,Noida Mobile no 9891492921 :)

    ATL / WTL / STL performance tutorial question

  • How to access COM objects during runtime?
    A Abhishek Srivastava

    Hi there, :) One can access COM objects at run time , but the interface supported by this COM object should support IDispatch interface. CLSID objClsid; // initialize your obj CLSID in this variable using CoCreateInstance() get the IDispatch pointer. IDispatch *dispPtr; CoCreateInstance(objClsid, NULL, CLSCTX_ALL, IID_IDispatch , (void **) &dispPtr); if your object support IDispatch interface , it will return its instance , else it will return NULL. now using this dispPtr and IDispatch int isInfoAvailable; dispPtr->GetTypeInfoCount(&isInfoAvailable); if isInfoAvailable = 0 , that means this object does not provide run time type information of interfaces it supports. if isInfoAvailable = 1 , that mean now you can query for ITypeInfo interface pointer for getting information about the interface this object supports. now using GetTypeInfo() method you can further query for ITypeInfo interface , using which you can browse all the interface and methods of these interface supported by your COM object. and then using Invoke and GetIDsOfName methods of IDispatch you can also execute your method at run time. Regards Abhishek Srivastava Software Engg (VC++) India ,Noida Mobile no 9891492921 :)

    COM c++ com help tutorial question

  • Sending Events from a DLL
    A Abhishek Srivastava

    Hi there, It is really very easy to implement events in your COM DLL. whenever u insert any ATL object in your ATL project, using ATL Object Wizard. ATL Object Wizard property box pop ups, go to attribute tab and select the check box "Support connection points" this will create an dispinterface which can contain ur event methods. now u have to simply add method in this interface. compile ur code . and then in class view select ur class which is going to implement this evennt interface, right click on it and add implement Connection point. a dialog box will pou up , select that event interface and click OK. Now just fire this event method from ur code. In ur VB client when just select ur Dll object . and it will list out all event methods implemented by ur dll Object. u can simply slect those event method and can code whatever u like. :) Abhishek Srivastava Software Engg (VC++) India ,Noida Mobile no 9891492921 :)

    COM c++ tutorial com
  • Login

  • Don't have an account? Register

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