|
Hi,
i am using Visual Studio 2005. The problem I have is when i select VC++ and MFC application, I am giving a name to the application as ExamSchedule.
In the Sourcefiles.. I am able to see ExamScheuledoc.cpp,ExamScheduleview.cpp and ExamSchedule.cpp. I am adding few controls on to the dialog and doubleclicking on the dialog. So a new popup asking for cpp and .h file for that dialog is coming.
Should I give a new class name or the browse ExamSchedule.cpp file name which is already created.
Also when I am giving new .cpp and .h file, the program is not executing.
Plz let me know how to proceed.
Thanks,
Sai
|
|
|
|
|
What do you want to do and did you get any error when it deosnt work?
|
|
|
|
|
Hi everyone!
Few weeks ago I started to work on private CNC machine project. I’ve done a lot of design work using ProE. Now I am getting into control part. I am using Stepper Motors, which have to be controlled via Parallel Port.
My intent is to make software, which can send impulses on Parallel port pins with desired frequency. I can use Windows built-in timer but it is not enough accurate, I need more than 1000 Hz. For my machine I need something like 45000 Hz or more. I tried to use QueryPerformancecounter using while loop, but it use my CPU a lot. Is there any more accurate timer than 1 ms, which can call Event in windows, like Windows TTimer does? Is it possible to use QueryPerformance Timer or RDTSC, as Event Recalling functions? I am using Visual C++ 2005.
I look forward to your reply.
Best regards
Szymon
|
|
|
|
|
If your target platform is windows, then you can forget your idea: Windows is not a real-time operating system. Which means that you will never be able to have such an accuracy. You'll need to use a real-time operating system for that purpose.
|
|
|
|
|
Ok.
So what would you propose? What kind of system am I able to use?
What do you think about this kind of software (Mach2, Mach3, http://www.artsoftcontrols.com/artsoft/index/index.htm) or KCAM. They are installed on windows platform and intended to use to control Stepper Motors via Parallel Port. I can use them of course and I will as last chance but I would rather create something own.
I don't necessarily need Real Time control. I need any possibility to tact Parallel Port Pins with given frequency. Just every help is appreciate...
Thank you
Szymon
|
|
|
|
|
how can i convert bmp image to pdf ?
|
|
|
|
|
|
|
Google for Infra Recorder. I do not know if it is C++, but it works great.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
Because GDI+ support many formats and there is a function Image::GetThumbnailImage.
Is GDI+ not designed not very compatible with MFC?
So not convenient?
|
|
|
|
|
GDI+ is perfectly compatible with MFC.
It would be silly to wrap GDI+ classes in MFC classes since GDI+ already has a
class-based interface.
The list-view control is the problem. It has no built in functionality for displaying
thumbnail images. There's lots of articles showing how a list-view control can be
enhanced to provide this functionality.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks.
I'll search it agian.
|
|
|
|
|
Hint: Google "CListCtrl thumbnails"
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: It would be silly to wrap GDI+ classes in MFC classes
I beg to differ.
The GDI+ C++ wrapper classes are absolutely horrible from a MFC programmers perspective. Another MFC-ish wrapper makes life so much nicer even if it costs a tad bit in performance.
Just my two cents
|
|
|
|
|
Which one do you mean?
CxImage?
|
|
|
|
|
Here is the error Infomation:
error C2228: left of '.GetHBITMAP' must have class/struct/union type
Bitmap bmp(LPCTSTR(FilePath));
Color clr(255,0,0,0);
HBITMAP hBmp;
bmp.GetHBITMAP(clr,&hBmp);
CBitmap *pBmp=new CBitmap;
pBmp->FromHandle(hBmp);
PS: why Gdiplus::Black can't be used to replace clr here?
|
|
|
|
|
Maybe something like this...
Bitmap bmp(LPCTSTR(FilePath)); <font color="Red"><-- what's this? A WCHAR * is expected here, not a LPCTSTR</font>
HBITMAP hBmp;
bmp.GetHBITMAP(Color::Black, &hBmp);
CBitmap *pBmp=new CBitmap;
pBmp->Attach(hBmp); <font color="Red">//<-- attaching more permanent than FromHandle()! Check the docs!</font>
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
all right
But what about the error C2228?
|
|
|
|
|
Missing a header file for GDI+?
It compiles here.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Which in the stdafx.h
<br />
#include "gdiplus.h"<br />
#pragma comment(lib,"gdiplus.lib")<br />
using namespace Gdiplus;<br />
|
|
|
|
|
followait wrote: Bitmap bmp(LPCTSTR(FilePath));
The problem is there, which is why I commented on it in red.
What is FilePath? Whatever it is, it needs to be a WCHAR* or converted to a WCHAR*.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, it's ok now. I'm just curious why the error can be report this way, maybe it's the compiler's problem.
Thanxxxxxxxxxxxxxxxxxx
<br />
CString FilePath=ff.GetFilePath();<br />
WCHAR *p=FilePath.AllocSysString();<br />
Bitmap bmp(p);<br />
::SysFreeString(p);<br />
Color clr(255,0,0,0);<br />
HBITMAP hBmp;<br />
bmp.GetHBITMAP(clr,&hBmp);<br />
CBitmap *pBmp=new CBitmap;<br />
pBmp->Attach(hBmp);<br />
|
|
|
|
|
Also, you CAN pass Color::Black instead of creating a black Color object.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
My teacher just threw us into this world of Visual C++ so I really don't know what to do on this one. I am making a randomly generating Maze in Visual Studio. Here is the public section to my header file:
public:
CMaze ();
CMaze (const CMaze & other);
~CMaze ();
CMaze & operator = (const CMaze & other);
void Init (int R, int C);
void Instructions (CFrameWnd * windowP);
void Display (CFrameWnd * windowP);
CRect Move (dType direction);
void Message (CFrameWnd * windowP);
bool Finished();
What is CFrameWnd * windowP and what do I need to pass to the Display function to get my program to go to it?
Any Help Would be awesome.
|
|
|
|
|
From VC++ Help
"
The CFrameWnd class provides the functionality of a Windows single document interface (SDI) overlapped or pop-up frame window, along with members for managing the window.
To create a useful frame window for your application, derive a class from CFrameWnd. Add member variables to the derived class to store data specific to your application. Implement message-handler member functions and a message map in the derived class to specify what happens when messages are directed to the window.
"
There is different possibilities to get your programm running, depending on the existance of CView/CDoc or just Win32 API.
Take a look into your documentation.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|