|
Can you tell us what are you trying to achieve? What purpose does it server to manually set the size of a file?
-Saurabh
|
|
|
|
|
See here. Use of an edit control is optional.
You may also want to look at SetFilePointer() followed by SetEndOfFile() .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
I got some difficulity how to move bitmap image in my application
basically, the algorithm is like this,
I've got CDC as m_MapDC and it already being created and DrawPoint basically use for draw truck in the mapDC but the result is there is no truck in the map
However, If I use CPen class instead of using CBitmap, I can see the line is moving from one point to other point. Any body have suggestions
void Ctrainc::DrawPoint()
{
CBitmap btruck;
CBitmap *pbtruck = NULL;
pbtruck = (CBitmap*)m_MapDC.selectObject(&btruck);
m_MapDC.MoveTo(m_PrevTruckPoint.m_iX,m_PrevTruckPoint.m_iY);
//move to the new pos
m_MapDC.LineTo(m_CurrTruckPoint.m_iX,m_CurrTruckPoint.m_iY);
m_MapDC.SelectObject(pOrbtruck);
btruck.DeleteObject();
}
Regards,
Arif Liminto
|
|
|
|
|
To draw a bitmap on (x,y) position you need to:
(1) Create a memory DC, via CDC::CreateCompatibleDC .
(2) Select the bitmap into the memory DC.
(3) Use the CDC::BitBlt method.
See here [^] for a code sample.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
From the vc++ blog:
Get more done. The next version of Visual C++ is all about improving developer productivity for large-scale applications. Learn about the IntelliSense and browsing experiences, changes to the project and build system, project-less browsing, collaboration through remote symbol indexing, and custom visualization of symbolic information.
...
Yes, "10 Is The New 6" refers to the IDE, not to the compiler and libraries. The compiler and libraries have steadily improved from VC6 to VC7.0 to VC7.1 to VC8 to VC9 (to VC9 SP1, with TR1 and MFC goodies!), and I like to say that "10 Is Greater Than 9".
After PDC, we'll have VCBlog posts explaining the new compiler and library features in great detail.
So a return to a more v6-like IDE, which everyone seemed to love. Too bad it's taken 7-8 years to get there.
|
|
|
|
|
Can someone take a look at my code. I'm having some errors and do not know how to correct. Not looking for someone to give me the answer, but walk me though to better understand.
This is a compiler to compute wages.
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[ ])
{
int a = 40; //No. of hrs worked during week
float b = 12.75; //Pay rate: dollars per hour
float c = 510;
cout << a * b;
cout << c;
//Weekly wages
// read in the hours worked
cout << endl;
cout << "Number of hours worked during the week (integer) = ";
cin >> hours_worked;
// read in the pay rate
cout << "Hourly pay rate (specify two digits after the decimal point) = ";
cin >> pay_rate;
// compute wages
sum = (number of hours * pay rate);
// display the result
cout << endl;
cout << "The weekly wages are: $" << wages << endl;
return (0); // terminate with success
}
|
|
|
|
|
Exactly what errors?
Please use code tags.
|
|
|
|
|
Here are the errors.
1>assignment 3.cpp
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(38) : error C2065: 'hours_worked' : undeclared identifier
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(43) : error C2065: 'pay_rate' : undeclared identifier
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(47) : error C2065: 'sum' : undeclared identifier
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(47) : error C2065: 'number' : undeclared identifier
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(47) : error C2146: syntax error : missing ')' before identifier 'of'
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(47) : error C2059: syntax error : ')'
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(52) : error C2065: 'wages' : undeclared identifier
1>Build log was saved at "file://c:\Documents and Settings\Chuckie Taylor\My Documents\C++ Assignments\Assignments 3\assignment 3\assignment 3\Debug\BuildLog.htm"
1>assignment 3 - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
|
|
|
|
dtaylor01 wrote: error C2065: 'hours_worked' : undeclared identifier
Start with the first one, this says you are using a variable 'hours_worked' but haven't declared what type it is. The compiler doesn't know what it is, an int, float..? You have to specify this before you use the variable (or when you use it).
|
|
|
|
|
Ok i'm down to one error
>;assignment 3.cpp
1>;c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(50) : error C2143: syntax error : missing ';' before '<<'
1>;Build log was saved at "file://c:\Documents and Settings\Chuckie Taylor\My Documents\C++ Assignments\Assignments 3\assignment 3\assignment 3\Debug\BuildLog.htm"
1>;assignment 3 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
|
|
|
|
Post what you have so far.
|
|
|
|
|
dtaylor01 wrote: 1>;c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(50) : error C2143: syntax error : missing ';' before '<<'
The code you've shown does not have 50 lines so we can't possibly know what exactly is causing the problem. Look at lines 49 and 50 to see if anything is missing.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
<this my="" be="" a="" dumb="" but="" code="" tag="" is="" when="" you="" use=""> symbol in your work right? >
|
|
|
|
|
Sorry for reposting, but I'm hoping to post the question better. I am using Visual Studio 2008, trying to use a vendor supplied dll. I was given the .h, .lib, and .dll files. In the project, I #include "header", link the .lib file to the project, and physically place the .lib and .dll files in the search path. Here is the gist of the header file.
#ifndef __GP3_HEADER_AWC
#define __GP3_HEADER_AWC
extern "C" {
__declspec(dllimport) HANDLE __stdcall GP3OpenCom(int port);
__declspec(dllimport) void __stdcall GP3CloseCom(HANDLE);
__declspec(dllimport) void __stdcall GP3SetLED(HANDLE h,BOOL state);
...}
#endif
But when I try to build it, I get alot of errors thrown at me. Here is a collection of the first few errors.
1>Compiling...
1>main.cpp
1>c:\documents and settings\administrator\my documents\geno\programs\gp3\gp3\gp3.h(5) : error C2143: syntax error : missing ';' before '__stdcall'
1>c:\documents and settings\administrator\my documents\geno\programs\gp3\gp3\gp3.h(5) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\documents and settings\administrator\my documents\geno\programs\gp3\gp3\gp3.h(5) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\documents and settings\administrator\my documents\geno\programs\gp3\gp3\gp3.h(6) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\documents and settings\administrator\my documents\geno\programs\gp3\gp3\gp3.h(6) : error C2182: 'GP3CloseCom' : illegal use of type 'void'
What is going on here? Am I doing something wrong, or is there something messed up with the header file?
|
|
|
|
|
The compiler does not know what HANDLE is. You have to #include <windows.h> before you include this header file.
|
|
|
|
|
Just wondering,does anybody tried this enhancements of VS2008 MFC?
What pro and contras?
Thanks.
|
|
|
|
|
Hi,
In my application i need to put an interface with navigation like norton antivirus'interface(like graphical menu items in the left side of the app. Items will be displayed only if the user clicks a item in the left side.)
Please tell me how to begin.
Regards,
John
|
|
|
|
|
Well, it sounds like a splitter window with two panes. The one on the left is a list view that contains icons, and the one on the right could be some other view.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello, can you write an example for me (I am not able to do this) for with DragDropHandlers catch file copy or move and get this arguments to a program and not at the system.
For that's I use my own copier for do the copy.
Thanks for your help.
|
|
|
|
|
alpha_one_x86 wrote: (I am not able to do this)
Can't or won't? Have you searched for WM_DROPFILES or DragQueryFile() ? As an added bonus, see here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I'am just not able because I work in Qt not in api win32. I don't understand how do it (It's 1years what I search).
|
|
|
|
|
I have used NtQueryInformationProces, struct PROCESS_BASIC_INFORMATION and struct PEB etc to access process info and then retrieve its arguments. It works great in WIN32 but stops working in WIN64 mainly because of the address space problem. Just be clear I am using 64 bit process to access other 64 bit process's info (its parent process). Can any body provide hint!
Thanks!
Jack Rong
|
|
|
|
|
Jack Rong wrote: I have used NtQueryInformationProces, struct PROCESS_BASIC_INFORMATION and struct PEB etc to access process info and then retrieve its arguments.
I'm curious ... why are you using a deprecated function?
The docs state
"It is best to use the CheckRemoteDebuggerPresent and GetProcessId
functions to obtain this information."
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all..
I've a dialog box in which i'm using AnimateWindow. Everything is OK but whenever my dialog Animate(Up to down in may case with the help of)
AnimateWindow(hWnd, 300, AW_SLIDE | AW_VER_NEGATIVE);
My mouse just gets busy if i put on Dialog Box.. I mean busy Icon and i can't click on any of the control inside it..
I know it's refreshing everytime it moves. But how can i overcome this problem..
Thanks all
|
|
|
|
|
I don't know anything about AnimateWindow but if it is using the UI thread to do a bunch of processing then you can't click on anything in the UI, period, regardless of what the mouse cursor looks like.
led mike
|
|
|
|