|
I can see a few problems straight up:
1. [Probably not important] If sf is an int, then that's probably not what you want.
2. Trig functions expect angles in radians not degrees, so an angle of 45.0 is probably not what you want.
3. Where is center being set? It could be some wild value so that all the drawing is offscreen. Look at the actual values you are passing to MoveToEx and LineTo.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Peter_in_2780 wrote: Look at the actual values you are passing to MoveToEx and LineTo.
Peter_in_2780 wrote: If sf is an int
No its double.
Peter_in_2780 wrote: Trig functions expect angles in radians not degrees,
I have changed it to
int a = 45;
float Angle = ( 3.142 * a ) / 180;
Peter_in_2780 wrote: Where is center being set?
I am gettin g the center by calculating the bitmag as..
center.x=(((pCellInfo->rcBitmapRect.right-pCellInfo->rcBitmapRect.left)/2)+pCellInfo->rcBitmapRect.left);
center.y=(((pCellInfo->rcBitmapRect.bottom-pCellInfo->rcBitmapRect.top)/2)+pCellInfo->rcBitmapRect.top);
Thanks
Raj
|
|
|
|
|
#include <iostream>
#include <windows.h>
using std::cin;
using std::cout;
using std::endl;
void main()
{
WIN32_FIND_DATA FileDetails;
HANDLE ListDirectory;
ListDirectory = FindFirstFile(L"C:\\*", &FileDetails);
cout << FileDetails.cFileName << endl;
FindClose(ListDirectory);
}
I read on MSDN the code is deprecated on Windows 7! Any ideas why it is giving me junk text as a result.
Does anyone also know a 1 line fix for the 3 using declarations?
|
|
|
|
|
Your code seems unicode, thats why cout prints junk.
use unicode version as wcout<<FileDetails.cFileName<<endl;
|
|
|
|
|
The using keyword is used as follows -
#include <iostream>
using namespace std;
|
|
|
|
|
It's only used that way if you want to dump the whole of the std:: namespace into your code. You can also use it on individual identifiers (as the original poster did) and to change the visibility of class members.
Ash
|
|
|
|
|
Fareed Rizkalla wrote: Does anyone also know a 1 line fix for the 3 using declarations?
This made me think the OP wanted it so.
|
|
|
|
|
Good point! Next stop I'll be starring on the muppet show.
Ash
|
|
|
|
|
I'm trying to make a program that reads the temperature from the cpu and then sends it to my arduino duemilanove, where I have a 4 digit 7-segment display. I've been searching for a while but found nothing about reading the temperature from cpu's DTS (Digital Thermal Sensors). I don't want to use CoreTemp or any other related tool.
EDIT: By the way, I have a asus n61jq laptop with intel core i7 720QM
|
|
|
|
|
|
I'm trying to use __readmsr() intrinsic function to get the temperature, but it keeps giving this error:
"Unhandled exception at 0x000000013fd81009 in test.exe: 0xC0000096: Privileged instruction."
It seems that rdmsr instruction must be executed in privileged mode.
EDIT: Is there any way of switching from user-mode to kernel-mode instead of making a driver?
modified on Tuesday, August 17, 2010 8:29 AM
|
|
|
|
|
Is the Win32_TemperatureProbe class of any help?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
It could help but I never worked with WMI, so I will need a example of its use.
I've just downloaded the WDK and I will try to read the temperature by making a driver.
This could be fun!
|
|
|
|
|
Using WMI will be much simpler than doing a driver - search CP and you'll find lots of articles on WMI such as Making WMI Queries In C++[^]
Judy
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|
I've got an SDI MFC application.
The app has a ribbon. On the "home" group of the group is a clipboard panel with cut/copy etc buttons on it.
I want to show a popup dialog, well actually, CDockable pane.
I want the user to be able to use the clipboard buttons to invoke the cut/copy handlers in the dialog.
Is the possible?
|
|
|
|
|
I haven't properly understood the question, but if you want to invoke the cut/copy/paste handlers of one window from another, you could try sending the standard WM_CUT /WM_COPY /WM_PASTE messages to the target window.
|
|
|
|
|
hi..
i am trying to install htk 3.2
but it is giving an error
cl not recognized as an internal or external command
..
i hv installd microsoft visual studio 2003 .net 2003
|
|
|
|
|
I would guess that the Visual Studio environment variables were not registered correctly.
Find the vcvars32.bat file in the Common7/Tools directory of VS03 and execute that in your command prompt window and it should set the variables for you.
When you find that batch file you can set up a shortcut to a command prompt that will load the batch file automatically. You do this by setting the shortcut's target to something like :
%windir%\system32\cmd.exe /k vcvars32.bat
but you have to set the full path to the batch file or move it somewhere that you can access easily.
|
|
|
|
|
hi.
i ran vcvars 32 from command prompt but now it is giving an error as follows:-
C:\pri_nij_new\htk\HTKLib>nmake /f htk_htklib_nt.mkf all
Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
cl /nologo /c /ML /W0 /GX /O2 /G5 /Ob2 /D "NDEBUG" /D "WIN32" /D "_WINDO
WS" /I "." /D "WIN32_AUDIO" /D ARCH=\"WIN32\" HShell.c
HShell.c
c:\pri_nij_new\htk\HTKLib\HShell.h(48) : fatal error C1083: Cannot open include
file: 'sys/time.h': No such file or directory
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
C:\pri_nij_new\htk\HTKLib>
|
|
|
|
|
The compiler can't find a "system" include file which usually means that the environment variables are not set right.
Open a command prompt and run vcvars32.bat. From this SAME command prompt type set and see what the INCLUDE variable is set to. You need to be able to find the time.h file in the sys subdirectory of one of the directories listed in the INCLUDE variable.
At this point you need to start learning how to debug your environment. I have listed the basic steps to do this so best of luck with it.
|
|
|
|
|
i ran vcvars again from command prompt and on typing set it is giving me a big output as follows
actually i searched the outputs below having "include" but there is no system file......
In microsoft visual studio .net 2003\vc7\include it has sys folder but it is not having sys/time.h
it contains timeb.h and utime.h....
:-
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\Administrator\Application Data
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=XP10
ComSpec=C:\WINDOWS\system32\cmd.exe
DEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopPro
tection
DevEnvDir=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE
FP_NO_HOST_CHECK=NO
FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework
FrameworkSDKDir=C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1
FrameworkVersion=v1.1.4322
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\Administrator
INCLUDE=C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\ATLMFC\INCLUDE;C:
\Program Files\Microsoft Visual Studio .NET 2003\VC7\INCLUDE;C:\Program Files\Mi
crosoft Visual Studio .NET 2003\VC7\PlatformSDK\include\prerelease;C:\Program Fi
les\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\include;C:\Program Files\M
icrosoft Visual Studio .NET 2003\SDK\v1.1\include;C:\Program Files\Microsoft Vis
ual Studio .NET 2003\VC7\ATLMFC\INCLUDE;C:\Program Files\Microsoft Visual Studio
.NET 2003\VC7\INCLUDE;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\Pl
atformSDK\include\prerelease;C:\Program Files\Microsoft Visual Studio .NET 2003\
VC7\PlatformSDK\include;C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v
1.1\include;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\ATLMFC\INCLUD
E;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\INCLUDE;C:\Program File
s\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\include\prerelease;C:\Progra
m Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\include;C:\Program Fil
es\Microsoft Visual Studio .NET 2003\SDK\v1.1\include;C:\Program Files\Microsoft
Visual Studio .NET 2003\VC7\ATLMFC\INCLUDE;C:\Program Files\Microsoft Visual St
udio .NET 2003\VC7\INCLUDE;C:\Program Files\Microsoft Visual Studio .NET 2003\VC
7\PlatformSDK\include\prerelease;C:\Program Files\Microsoft Visual Studio .NET 2
003\VC7\PlatformSDK\include;C:\Program Files\Microsoft Visual Studio .NET 2003\S
DK\v1.1\include;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\ATLMFC\IN
CLUDE;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\INCLUDE;C:\Program
Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\include\prerelease;C:\Pr
ogram Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\include;C:\Program
Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\include;C:\Program Files\Micro
soft Visual Studio .NET 2003\VC7\ATLMFC\INCLUDE;C:\Program Files\Microsoft Visua
l Studio .NET 2003\VC7\INCLUDE;C:\Program Files\Microsoft Visual Studio .NET 200
3\VC7\PlatformSDK\include\prerelease;C:\Program Files\Microsoft Visual Studio .N
ET 2003\VC7\PlatformSDK\include;C:\Program Files\Microsoft Visual Studio .NET 20
03\SDK\v1.1\include;C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\
include\
JSERV=D:\oracle\ora90/Apache/Jserv/conf
LIB=C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\ATLMFC\LIB;C:\Program
Files\Microsoft Visual Studio .NET 2003\VC7\LIB;C:\Program Files\Microsoft Visu
al Studio .NET 2003\VC7\PlatformSDK\lib\prerelease;C:\Program Files\Microsoft Vi
sual Studio .NET 2003\VC7\PlatformSDK\lib;C:\Program Files\Microsoft Visual Stud
io .NET 2003\SDK\v1.1\lib;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7
\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\LIB;C:\Progra
m Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\lib\prerelease;C:\Prog
ram Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\lib;C:\Program Files
\Microsoft Visual Studio .NET 2003\SDK\v1.1\lib;C:\Program Files\Microsoft Visua
l Studio .NET 2003\VC7\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio .NET
2003\VC7\LIB;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\
lib\prerelease;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSD
K\lib;C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\lib;C:\Program
Files\Microsoft Visual Studio .NET 2003\VC7\ATLMFC\LIB;C:\Program Files\Microso
ft Visual Studio .NET 2003\VC7\LIB;C:\Program Files\Microsoft Visual Studio .NET
2003\VC7\PlatformSDK\lib\prerelease;C:\Program Files\Microsoft Visual Studio .N
ET 2003\VC7\PlatformSDK\lib;C:\Program Files\Microsoft Visual Studio .NET 2003\S
DK\v1.1\lib;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\ATLMFC\LIB;C:
\Program Files\Microsoft Visual Studio .NET 2003\VC7\LIB;C:\Program Files\Micros
oft Visual Studio .NET 2003\VC7\PlatformSDK\lib\prerelease;C:\Program Files\Micr
osoft Visual Studio .NET 2003\VC7\PlatformSDK\lib;C:\Program Files\Microsoft Vis
ual Studio .NET 2003\SDK\v1.1\lib;C:\Program Files\Microsoft Visual Studio .NET
2003\VC7\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\LIB;C
:\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\lib\prerelease
;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\lib;C:\Progr
am Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\lib;C:\Program Files\Microso
ft Visual Studio .NET 2003\SDK\v1.1\Lib\
LOGONSERVER=\\XP10
MSVCDir=C:\Program Files\Microsoft Visual Studio .NET 2003\VC7
NUMBER_OF_PROCESSORS=1
OLAP_HOME=D:\oracle\ora90\olap
OS=Windows_NT
Path=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE;C:\Program F
iles\Microsoft Visual Studio .NET 2003\VC7\BIN;C:\Program Files\Microsoft Visual
Studio .NET 2003\Common7\Tools;C:\Program Files\Microsoft Visual Studio .NET 20
03\Common7\Tools\bin\prerelease;C:\Program Files\Microsoft Visual Studio .NET 20
03\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1
\bin;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;C:\Program Files\Microsoft Vis
ual Studio .NET 2003\Common7\IDE;C:\Program Files\Microsoft Visual Studio .NET 2
003\VC7\BIN;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools;C:\
Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin\prerelease;C:\
Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin;C:\Program Fil
es\Microsoft Visual Studio .NET 2003\SDK\v1.1\bin;C:\WINDOWS\Microsoft.NET\Frame
work\v1.1.4322;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE;C:
\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN;C:\Program Files\Micros
oft Visual Studio .NET 2003\Common7\Tools;C:\Program Files\Microsoft Visual Stud
io .NET 2003\Common7\Tools\bin\prerelease;C:\Program Files\Microsoft Visual Stud
io .NET 2003\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio .NET 200
3\SDK\v1.1\bin;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;C:\Program Files\Mic
rosoft Visual Studio .NET 2003\Common7\IDE;C:\Program Files\Microsoft Visual Stu
dio .NET 2003\VC7\BIN;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7
\Tools;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin\prer
elease;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin;C:\P
rogram Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\bin;C:\WINDOWS\Microsoft
.NET\Framework\v1.1.4322;C:\Program Files\Microsoft Visual Studio .NET 2003\Comm
on7\IDE;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN;C:\Program Fi
les\Microsoft Visual Studio .NET 2003\Common7\Tools;C:\Program Files\Microsoft V
isual Studio .NET 2003\Common7\Tools\bin\prerelease;C:\Program Files\Microsoft V
isual Studio .NET 2003\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studi
o .NET 2003\SDK\v1.1\bin;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;C:\Program
Files\Microsoft Visual Studio .NET 2003\Common7\IDE;C:\Program Files\Microsoft
Visual Studio .NET 2003\VC7\BIN;C:\Program Files\Microsoft Visual Studio .NET 20
03\Common7\Tools;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tool
s\bin\prerelease;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tool
s\bin;C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\bin;C:\WINDOWS
\Microsoft.NET\Framework\v1.1.4322;D:\oracle\ora90\bin;D:\oracle\ora90\Apache\Pe
rl\5.00503\bin\mswin32-x86;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\syst
em32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ZipGenius 6\;C:\Progra
m Files\proeWildfire 4.0\bin;C:\Program Files\proeWildfire 4.0\mech\bin;C:\MATLA
B701\bin\win32;;;;;;;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0409
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
|
|
|
|
|
hi...
i have checked the include folder in vc7 folder of microsoft visual studio .net 2003 . it has sys folder but it is not having time.h.
also in visual studio versions 2005 and 2008 i have checked the same...
during installation of htk..
after running vcvars32 when i write nmake command it gives an error as:-
sys/time.h not found...
|
|
|
|
|
Have you tried to find out where it is ?
In VS 2003 time.h is not in the sys directory.
|
|
|
|
|
actually in the include folder there is one time.h but when we copy it to the sys folder of include it gives an error as:-
tv_sec and tv_usec should be of struct or unoin type...
and the sys folder has timeb.h and timeu.h
on renaming dem it gives the same error...
PLEASE also read the reply of mine above i gave the complete response of set command that u suggestd to perform.
|
|
|
|
|
create a regular dll(static link) in MFC. Add a dialog and export this dialog rom dll in below dll function function
__declspec(dllexport) void ExportDialog()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
dialogclass obj;
obj.DoModal();
}
When i call this dll function in a MFC exe(dialog base application) it displays the dialog.
But if i insert an activex control on dialog say calender,web browser etc and call dll function ExportDialog() in mfc exe then dialog box does not display.
I have used AfxEnableControlContainer in initinstance of application class in regular dll but still dialog is not display
what should i do to display dialog
My mfc exe is statically link. if i build extension dll and call its function which export dialog box then program is crash
please suggest
|
|
|
|