Answer Questions
MichaelEaton CWinThread derived Object and Menu trouble
Hello I can't find my previous question so i'll re-ask it; I created few WinThread derived objects With which i send and receive info by posting messages. When i click on the menu While my threads are runing they seems to crash or to terminate their message processing. The thread being terminated not in a clean manner it causes my program to randomly behave. I use these this thread with multiple Windows and in a various range of way but only the menu affects their stability. Does anybody can lead me on the right path to overcome this problem Thanks a lot. After a bit more of thinking and testing. I've found the answer to my problem. As I thought the menu was interacting with my threads but not directly. The ...Show All
Lee Witherington Overriding ProfessionalColorTable Colors in VC++ 2005?
Hey there all, I've been all over MSDN looking for a way to override the ProfessionalColorTable colors in VC++ 2005, however due to all the example code being in C#, I've been unsuccessful. I have the following code: public ref class CustomProfessionalColorTable : ProfessionalColorTable { public: Color^ MenuStripGradientBegin::get() { return SystemColors::Desktop; } }; I would think that it'd work but apparently it doesn't. I get the following errors on compile: error C3254: 'CustomProfessionalColorTable' : class contains explicit override 'get' but does not derive from an interface that contains the function declaration. and error C2838: 'get' : illegal qualified name in member declaration What have I done wro ...Show All
Amjath Statusbar Updation in Multithreading Environment..
Hai, Iam using SDI application. I have to update status bar text in a thread, running in Application class. code as follows, ///////////////code in main class////// HWND Sts = m_wndStatusBar->GetSafeHwnd(); ///////////////code in Application class////// extern HWND Sts; //////////////////code in the thread CStatusBar* pSts = (CStatusBar*)CStatusBar::FromHandle(Sts); pSts->SetWindowText("Waiting for File..."); Everything work fine, is this the right procedure to update the Status bar or to pass message to mainframe to update Thanks in Advance. Generally, CWnd-derived classes should be accessed only from the thread which created them. Classic way is to send/post message to the win ...Show All
Brian2 Presenting a C++ library (.lib) for use in C# project
I have a collection of C++ programs and the C++ libraries they use. The libraries currently compile to a .lib format. Changing the project property to use a .dll results in multiple reference errors. Without having to go through the entire collection of source files, is there a way to create any kind of project in a .NET language that would provide a "wrapper" for the existing .lib files so that they could be used in that environment. Thanks. RickW_Houston wrote: Without having to go through the entire collection of source files, is there a way to create any kind of project in a .NET language that would provide a "wrapper" for the existing .lib files so that they could be used in that environment. Yes (s ...Show All
Tubby2877 Strip debug info from an obj or lib?
In VC 2005 what tool can I use to strip (remove) debug info from an already built LIB or obj file No, thanks anyway, but I've got them (many versions in fact), but any versions beyond February 2003 Platform SDK have this problem. This is due to the internal build process that Microsoft uses. So for example the Vista SDK versions of shell32.lib would have this problem also. In some cases I want to take advantage of functions that were added recently (after Feb 2003) It's a third party library I want to remove the debug info from. I need to have a clean shell32.lib and uuid.lib for some legacy DLL that needs VC 6.0. Those libs have debug info in&n ...Show All
Michael Baxter How to read the Link Error message?
Hello all: I find it is quite hard to understand the Link Error(I use VS. Net 2005 Professional). If I include the following operator member function in the file "Triangle.cpp" rather than in the file "Triangle.h". inline bool Triangle::operator==(const Triangle &rhs) const { return (_length == rhs._length) && (_begin_pos == rhs._begin_pos); } Then call it by using the following statements: Triangle t4(1, 2); // initialize _length as 1 and _begin_pos as 2 Triangle t5(1, 2); if (t4 == t5) cout << "equal " << endl; else cout << "not equal " << endl; I will get the following build errors: ------ Build started: Project: TestOne, Configuration: Debug W ...Show All
megaman5 Programming an ATL Windows Service
Hi all.... I created an ATL Windows Service which has an ATL Simple Object. The wizard has created a global module variable named COraPool_V2Module _AtlModule; whhich is derived from CAtlServiceModuleT. The question is : How can I access that variable from a method of that simple object I'm using VS2005. When I used VS 6.0 it was easy to accomplish this, but how in VS 2005 and VC++ 7.0 Thanks Jaime Hi, _AtlModule should be defined as extern in some header. Include that header in you ATL simple object cpp or h file and use just _AtlModule. -- SvenC ...Show All
Alessandro Camargo Accessing USB with VC++
Hi! I m doing a college project and i have 2 access an analog signal via USB port! I have used C/C++ to access serial port but dont know how 2 do with USB. Can anyone give me a code snippet to access USB It depencs on the device. Does the device have a driver for it Is there documentation of the device for programmers Accessing USB devices will require you to either write your own driver, or get a generic one such as http://www.thesycon.de/eng/usbio.shtml . This may help you. Communicating with USB Devices Can I find some C/C++/VC++ code samples to access a USB HID class device As far as I know, it does not need to write ur own driver to access ...Show All
Johan Nordberg Smartbridge Alerts
I too am receiving the "entry point not found" message. I have very little technical knowledge and would appreciate assistance in any fashion. thanks. Helen McLaughlin That's great. Glad you were able to. It seems to be something turning up as pretty common affecting online service files. Bob What is the exact error message you are seeing Which entry-point is not being found This much more likely to an issue with SmartBridge then it is with Windows. Did you follow the link I gave earlier I am too receiving the "entry point not found" message. I have very little technical knowledge and would appreciate assistance in any fashion. thanks. Xavier Gonzalez ...Show All
KevinBurton Unhandled exception
Hi All, hr=CoCreateInstance(CLSID_Component2 ,NULL,CLSCTX_INPROC_SERVER,IID_IUnknown ,( void **)&pIX); //REsult of HR is s_ok but when i am calling following function i am getting error as: Unhandled exception at 0x00000000 in App.exe: 0xC0000005: Access violation reading location 0x00000000. hr= pIX->SetAuthor(( char *) 'd' ); Additional info: The code lies in lib .which is then added to dll. Plz help . This exception occurs when u access a null pointer. As the hresult is S_OK then the problem may be the parameter passed to the function. The function may be accepting a char* and u r passing const char*. Try char sz[100] = {0}; strcpy(sz, "d"); ...Show All
dragoncells calling sleep in header function causes wrong thread to sleep
I'm experimenting with the BackgroundWorker and have a problem. If I use the Sleep method inside the dowork method the thread correctly sleeps, but, if I put the Sleep call in a function defined elsewhere in the code the main form sleeps. Does this only depend on the position of the call Is there a way to avoid it The sleep will be performed on the thread that is calling it. If you put a breakpoint on that line, you should see the thread calling it. Whether it is in a header function or somewhere else isn't relevant. ...Show All
Ram Tangutur How to trim all space character in a string?
I want to trim all space character in a string, for example there is a string " 1000 + [101001] + [101002] ", how to get another string like this: "1000+[101001]+[101002]". Are there better method to do that thks An efficient version in C only: #include <string.h> #include <stdio.h> int main() { char src[] = " 1000 + [101001] + [101002] " ; char * dst = new char [strlen(src)+1]; // worst-case size allocation char *srcpos = src, *dstpos = dst; do { if ...Show All
Kesava Small executables
Hello. I'm working on a project where file size matters. I'm compiling an empty project about 6-7 kb-s. is there anyway to get smaller file thanks, I know about packers. I will use them, but what I want is that I saw some compiled exe files which were 3 kb. so I wonder, is there any way i can compile exe files in such size using VS 2005 Try a packer, such as http://www.bitsum.com/pec2.asp . Managed executables are generally smaller than native executables, so you might have seen one of those. Other than that, there are a number of tricks you can apply to get smaller output, such as replacing the C runtime library. Articles and texts describing the procedures can be found on MSDN, CodeProject, Codeguru, and a bunch of ot ...Show All
Cam70 What does this icon mean?
I've been trying to work out what this little stop sign icon attached to the file d3dx9d.lib in the image means: http://members.gamedev.net/mattnewport/vs2005-icon.png . Can anyone enlighten me Is there somewhere that explains all the icons in the MSDN docs I spent a while looking around and all I could find is docs for the source control icons. Right-click this file and open Properties. Maybe Visual Studio cannot find it. There's nothing obvious about the properties page that explains what the icon means. The relative path in the properties pane (the file properties rather than the properties you get when you right click in solution explorer) lists a relative path t ...Show All
Andrew Greatorex Access to Members of Top Level Class
If an object is declared as top level (^) how can you access its members For example: public ref struct DictionaryPath { public: DictionaryPath() {} ~DictionaryPath(){} String^ dictName; String^ dictPath; }; DictionaryPath myPath; // members can be accessed. DictionaryPath^ myPath; // now it is an "undefined object" whoose contents cannot be seen. public ref class DictionaryPath { public: DictionaryPath() {} ~DictionaryPath(){} String^ dictName; String^ dictPath; }; DictionaryPath^ myPath = gcnew DictionaryPath(); myPath->dictName = L"name 1"; If you want to get array ...Show All
