#include "singletonFile.h" Single one ; if(one == NULL) one = Single::getInstance(); else return one;
User 1149186
Posts
-
Singleton class -
Singleton classAdd the #include diective in the .cpp where u want to create the singleton class.
-
Problem with DllSir, I have a dll named Dll.dll. There were no errors at build time. Later on when I wanted to access the functions of this DLL through client,Then a Runtime error -Bad Image occured. The contents of this message are - "The application or DLL C:\\WINNT\\Dll.dll is not a valid Windows image.Pls check this against your installation diskette." What should I do? Why this occurs?
-
Query on WH_KEYBOARD Experts helpSir, Thx for the response. This is the code for a global hook which I defined in MainFrm.cpp But even without using a dll this should get fired after registering the hook by calling SetWindowsHookEx in OnCreate of CMainFrm Pls correct me if I m wrong . LRESULT CALLBACK KeyboardProc(int code,WPARAM w,LPARAM l) { if (code < 0) return CallNextHookEx(m_hookData,code,w,l); unsigned char state[256]; if( w == VK_CAPITAL) { GetKeyboardState(state); if(state[VK_CAPITAL] == 1) { state[VK_CAPITAL] =0; SetKeyboardState(state); } } return CallNextHookEx(m_hookData,code,w,l); }
-
Query on WH_KEYBOARD Experts helpI called a global hook and wrote the code in CMainFrm.cpp fie and called SetWindowsHookEx in OnCreate of CMainFrm. I wrote the code KeyboardProc here. When I tried to debug it ,The actual KeyboardProc deined in this file is not geting called. Pls solve this as I will extend this app using DLLs later.
-
Hooks ProcedureWhere to place the actual hook code? In CMainFrm or CWinApp.
-
Info on HooksCan somebody tell me what hooks are? Why are hooks used? When DisplatchMessage is called Does Window places a hook before passing to WndProc. Pls guide Tiger
-
Mapping of events -MFC InternalsHow should I map my own events and notifications in MFC? In my app I created a Dialog box in a SDI app where I have events in one Combo Box and Notifications in another Combo Box? Now I wish to map events and notifications, How should I proceed?
-
Mapping of events -MFC InternalsIn MFC,can somebody explain me how the mapping takes place.I mean where does the info comes -list of messages? Does it come from a database? I know that DECLARE_MESSAGE_MAP() creates 3 entries. One of which is structure of array which consists of eventsid and functions call.
-
Experts help with Threads with NotificationsThx for the response. Should the events be defined in a header file. I call a function which is already defined in a dll /in my application. Will that function generates an event like I press a button which in turn calls a function. The event names should be defined #define. Can u help me with a code snippet. Regards Regards Yadagiri
-
Outlook Express lacks some featuresWhat I am looking in OutlookExpress is Whenever any mail comes in to my inbox,I click it. On the right side pane ,The folders are created by itself denoted by '+ ' sign. The + sign indicates that the mails aremaintained in a tree view. I do not want to create a folder. The folders should be created by themselves like MS Outlook. Pls guide. Regards Yadagiri Kuttanur
-
HooksWhat are hooks in win32 ? Why are these hooks used? Can anybody give me a live example of this? Regards Tiger007
-
Experts Guide regarding MAC Address of a remote machine.I am able to get the MAC address of any machine connected in my LAN network . Now How should I extend this app to obtain the MAC address of a remote machine? Experts Guide Regards Black Tiger 007
-
Problem with header file -MAC AddressAntony, The file is missing in VC 6.0 . Whereas the same program runs very well in Visual Studio.net Thanks Antony Bye
-
Create a GUID to uniquely identify a machine.Sir, I am trying to find a unique machine of the computers listed in my network. I can do it in 2 ways:By obtaining 1.IPAddress 2.MAC Address Since IPAddress is subject to change and MAC address changes if there is change in the hardware configuration. So the only way is to create a GUID of that machine. The question is how one should go about in creating GUID. I mean what are the functions should I use? Is there any API? I know that 2 utilities like GuidGen.exe and uuidGen.exe create unique GUIDS. Pls guide Regards
-
Create a GUID to uniquely identify a machine.Sir, I am trying to find a unique machine of the computers listed in my network. I can do it in 2 ways:By obtaining 1.IPAddress 2.MAC Address Since IPAddress is subject to change and MAC address changes if there is change in the hardware configuration. So the only way is to create a GUID of that machine. The question is how one should go about in creating GUID. I mean what are the functions should I use? Is there any API? I know that 2 utilities like GuidGen.exe and uuidGen.exe create unique GUIDS. Pls guide Regards
-
Problem with header file -MAC AddressAntony, When I searched the file I found it 2 locations 1. C:\Program Files\Platform SDK\Include 2. C:\Program Files\Microsodt Visual Studio.net 2003\Vc7\PlatformSDK\Include But I am running this application using VC 6.0. Regards BlackTiger007 BlackTiger007
-
Problem with header file -MAC AddressYa ANTONY ,Its already installed. I have run many window programs even getting the list of network resourcesWhen I wrote a smll program in Win32. All r running well excep this. Can somebody help me out. Regards BlackTiger BlackTiger007
-
query reg STL mapsI need to map an int to a class. so this is the code.I hope I am clear. #include #include #include sing namespace std; class one { int age; int sal; }one1; typedef map Map; int main() { Map theMap; Map::iterator theIterator; //Open the file //Read each line of file and store in class variables index = 0; while(!file.eof()) { one.age =50; one sal = 1000; theMap.insert(Map::value_type(index,one)); index++; } //to get the class theIterator = theMap.find(0); //Get the entire first record ?How should I achieve this which is stored in a class? cout << endl << "The class "<< (*theIterator).first; cout << endl << "The class "<< (*theIterator).second << endl ; return 0; }
-
query reg STL mapsSir, I m implementing std::maps and new to maps I am using int as the key and the class as the value. I have declared it like this But my main is to insert a int as the key and the entire class as the value. Also by giving the key ,I want to get the value using find function How to achieve this. Pls correct me if I am wrong. #include #include #include class one { int age; int sal; }one1; typedef map Map1; int main() { Map theMap1; Map::iterator theIterator1; one.age =50; theMap1.insert(Map::value_type(0,one.age)); theMap1.insert(Map::value_type(1,one.age)); return 0; } I am getting errors Regards