-
- Create countdown Timer in a Console Application
by Sebrules
- 2 Replies
- Last post
by Brian Kramer
- Hi, Im writing a simple TCP client console application that uses sockets to send messeges to a server. However, in the event that it can't connect to the server I have created a basic countdown timer to wait 60 seconds and try again. The Code is: int t = 60; while (t > 0) { cout << t-- << " Seconds Remaining" << std::endl; Sleep(1000); } printf("
-
- friend function generates c2248
by Juan Carlos Trimi&#241
- 3 Replies
- Last post
by Brian Kramer
- All,
I am having problem with a friend function generating error c2248. The code below shows what I am trying to do:
gregorian.h
---------------- class gregorian { friend bool operator<=(const gregorian &lhs, const gregorian &rhs) throw(); public: gregorian(void); //Default constructor (current system date). ... private: class gregorianImpl *pImpl;
-
- mgmcmp not located by dynamic link library msvcrt.dll
by wazzucoug763
- 2 Replies
- Last post
by Aleksandr Tokarev
- I have a problem that is significantly impacting my operating system. (XP professional)
"The procedure entry point mgmcmp cound not be located in the dynamic link library msvcrt.dll"
This is preventing me from loading some critical software and is preventing some of my control panel features from operating. I suspect it is causing other problems I just have not yet nailed down.
-
- How to avoid Busy Waiting?
by spree
- 9 Replies
- Last post
by Marius Bancila
- Hey everyone :)
I wish to know how can I translate a "busy waiting loop" approach into an event driven approach
Lets say I have a queue of tasks, whenever there are elements in the queue, a process has to treat these elements
Now I do it like this:
while(1){
if(MyQ.Size()>0){
My.Q.RemoveHead ....
}
}
This approach causes the cpu to work on full load, even if
-
- Mouse detection for buttons
by Nathan87
- 3 Replies
- Last post
by TilakGopi
- Is there a way to detect when the mouse is hovering over a button in MFC
-
- CEdit Limit
by chdpng
- 7 Replies
- Last post
by Andreas Masur
- Hi,
I'm using CEdit control and set the limit to 255, but you can still paste texts more than 255 characters. Do you have a link to any documentation regarding this
Thanks,
Chad
-
- msvcr80.dll problems: version 8.0.50727.363 versus 8.0.50727.42
by Timon Christl
- 2 Replies
- Last post
by Timon Christl
- I have a really strange problem. I'm using Visual C++ 2005 Express installed, and everything worked fine ever since I installed it. But at some point during the last few days something broke, and now I can't run my programs anymore. I started to investigate, and found this: A simple test program like this (test.cpp): #include <stdio.h> int main() { printf("Hello, world!\n");
-
- Regarding build
by mfdiqwer
- 3 Replies
- Last post
by Viorel.
- Hi , I started VC++ with new win32 console project. For that I added 2 .cpp files and 2 .hh files Those files are compiled individually fine , but when I start build It is giving following error "Test.obj : error LNK2001: unresolved external symbol "private: static int Test::t_count" ( t_count@Test@@0HA)" my files are : Test.hh #define MAX 50 class Test { public: Test* oper
-
- pseudo-random; time; srand...
by Jerry584894
- 4 Replies
- Last post
by scor7910
- The code:
Code Snippet
#include <iostream> #include <cstdlib> #include <string> #include <fstream> #include <cmath> #include <algorithm> #include <time.h>
using namespace std;
srand( (unsigned)time( NULL )); void main() { }
has these errors:
C:\Documents and Settings\JiangLiu\My Documents\jerryc\Debug\tests.cpp(1
-
- Modeless dialog doesn't open if there are slider controls on it
by bodisan2000
- 4 Replies
- Last post
by bodisan2000
- Hello, I have a problem that is related to the slider controls. The problem is simple: the slider controls are on a modeless dialog. On my vista PC, the dialog opens and the sliders work as they should. But when I send the release build to someone (because the debug release seems to have a problem with configuration) using xp, the dialog doesn't want to open at all. I should say that I did find a
-
- Help button get chm instead of hlp
by Simon Heffer
- 13 Replies
- Last post
by CARTHIC
- I have a application built around a CPropertySheet derived class. The help button is looking for 'app.hlp' file (this is the default MFC stuff, I've not added anything other than moving the button). How do I get it to look for a 'app.chm' file instead I've tried the following using a test help file in InitInstance() //First free the string allocated by MFC at CWinApp startup. //The string is a
-
- How to access each multi objects property?
by stn
- 5 Replies
- Last post
by stn
- Compiler: VC++ 2005.
Application: Win Forms
Subject: How to access each multi objects property
I have multiple picturebox s in a form, i.e. pict01, pict02, бн pict19.
And, I need to assign each file to its image property (i.e. pict01->Image).
Instead of writing
pict01->Image = "" ;
pict02->Image = "" ;
pict03->
-
- ActiveX, this, iexplorer
by m1n
- 1 Replies
- Last post
by Bite Qiu - MSFT
- Hi it hapend something strange, when i start my activex control from inside the iexplorer and call this pointer from inside the *ctrl class, and try to create pointer with CClientDC dc(pWnd->this), when try to draw over dc it paint to desktop, not to control, why that can be hapening. Thanks.
-
- Link error LNK2019 redux
by ac30boy
- 5 Replies
- Last post
by ac30boy
- I reviewed the previous thread but couldn't resolve my issue using the info there. The errors I'm getting are: Error 1 error LNK2019: unresolved external symbol __imp__SetupDiGetClassDevsA@16 referenced in function _main USBReaderC.obj Error 2 error LNK2001: unresolved external symbol _USB_1208LS_GUID USBReaderC.obj I found the lib file that contains the function and manually added it to
-
- cannot build project
by alyza8716
- 1 Replies
- Last post
by crescens2k
- how do i need to solve this problem this error occured when i am build the project. this is the error
1>Compiling...
1>Project : error PRJ0002 : Error result -1073741800 returned from 'C:\Program Files\Microsoft Visual Studio 8\VC\bin\cl.exe'.
1>Build log was saved at "file://c:\Documents and Settings\alyza2501\My Documents\Visual Studio 2005\Projects\UiTM_JW\UiTM_JW\Debug\B
-
- Vector of an Object - [Solved]
by ShiZero
- 8 Replies
- Last post
by Simple Samples
- Hey everyone.
Solved - Read at the bottom
I'm usually not prone to ask for help with my coding issues, mainly because I'm at a very basic level of C++ programming and, so far, I've managed to find the answers to what I need after a bit of researching, both online and through my books. But this time, everything has failed me. Perhaps because it's a rather specific subject I'm asking a
-
- Generic function with common operator
by eldiener
- 8 Replies
- Last post
by eldiener
- Let us suppose I want to create a generic function which takes to parameters of the same type, adds the values, and returns the result. So I try: generic <typename T> static T add_values(T first,T last) { return(first + last); } only to get: error C2676: binary '+' : 'T' does not define this operator or a conversion to a type acceptable to the predefined operator which is understandable sinc
-
- Problem while File read
by Watashi_me
- 1 Replies
- Last post
by Carl Daniel
- Hello, I think it is very silly, but i couldnt trace out the problem. I am trying to read 3 lines from file using fgets, then using fseek i m placing the pointer back one line. But after that when i do fgets i m not getting the complete line.Instead first 3 charecters are missing. My code looks like for(i = 0; i < 3; i++) fgets(strBuf,500,fpInFileNext); cnt = strlen(strBuf); fseek
-
- error c2065 undeclared identifier
by LOST561564
- 5 Replies
- Last post
by LOST
- Hi, i'm new to visual c++. I dropped a TextBox on Form1
named box1. In Form1.cpp I have the following:
#include "StdAfx.h"
#include Form1.h"
void checklength()
{
if(box1->Text->Length!=0) {
}
I am getting the error message:
error c2065:'box1':undeclared identifier
I tried writing Form1->box1->Text and still got the same
-
- How to add dialogs to my program?
by Roflcopter562076
- 7 Replies
- Last post
by Simple Samples
- Update: It won't even compile on my home PC. I get the following errors: ========================================================== e:\schoolcpp\CPP\ENCRYPT.CPP(15) : error C3861: 'clrscr': identifier not found e:\schoolcpp\CPP\ENCRYPT.CPP(26) : error C2065: 'apstring' : undeclared identifier e:\schoolcpp\CPP\ENCRYPT.CPP(26) : error C2146: syntax error : missing ';' before identifier 'openfile' e:
-
- Passing a value between forms
by Boromir
- 2 Replies
- Last post
by Boromir
- Gday, I work with Visual C++ Express, and is trying to find a way to pass a string value(a name for example) from a window, that has been opened from the main window, and to the main window itself. The string is written in a textbox, in the dialog window, and is meant to be placed in a listbox in the main window. This dialog window is just showing when it is needed to fill up the listbox in the ma
-
- Help with C++
by Cyberdaemon
- 4 Replies
- Last post
by J. A. Love
- Hi all, I am new to C++, been "programming" in VB and VB.net for 5 years and I have seen the light. Anyway I want to time a subroutine and I don't know how to in C++
In VB.net (framework 2.0)
Private sub MySub ()
dim ST as date = date.now
<my code to time>
dim TS as timespan = date.now - ST
console.writeline (TS.ToString)
console.read()
End
-
- Create different text color with GDI+
by Houari
- 2 Replies
- Last post
by Houari
- Hi All, How can I assign different color in a text using GDI+ I mean, I want to make something like this in GDI+: This is the example of coloring text (the text is in black, while the word "example" is in red) I've tried using the CharacterRange and then using SetMeasurableCharacterRanges to specify clipping region with SetClip and GetClipBounds. So the clipping region would have text
-
- All the threads that I create with _beginthreadex behave like if it were a single-thread application.
by Tarh ik
- 2 Replies
- Last post
by Tarh ik
- Hi Everybody!!
I have an odd problem, and I think this is more conceptual than an actual coding issue:
I create multiple (and almost identical) threads using the same call back routine so I can have multiple threads to handle a big load of requests... However, if one thread gets frozen, all threads get frozen as well.
I've been trying to figure out what I did wrong, but
-
- CString to BSTR conversion on the korean language.
by Si-Chang Hyun
- 6 Replies
- Last post
by Sahir Shah
- Dear Mr.,
I'm beginner to VC++.
I want to call ActiveX function in web.
And, the conversion to BSTR from CString is occurred in this ActiveX function.
But, the conversion on korean language does failed, even though conversion on english does success.
STDMETHODIMP CCSWATDCWorker::GetDecryptData(BSTR enc, BSTR *dec )
{
USES_CONVERSION;
CString temp(&qu