|
hi all,
how can i change a control´s version number. for example increment it by one with each compilation. Right now i always get 1,0,0,1 and if i want to change a cab file - this control is not being installed on some other remote machine (since version number does not change, i guess )
I tried to change
_wVerMajor
_wVerMinor
but it did not change anything
thanks for any help
|
|
|
|
|
Maybe this is usefull... This macro auto increments the version number on each build...
http://www.codeproject.com/macro/incprivatebuild.asp
|
|
|
|
|
Any ideas on compacting and repairing a database through ADO, or SQL, or DAO etc... in VC++.
Really getting desperate now...
|
|
|
|
|
Check these KB articles:
Q230496 Compacting Microsoft Access database via OLE DB
Q230501 HOWTO: Compacting Microsoft Access Database via ADO
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi All,
I have a interesting query.I have a ATL Service.In this service I want to create a Database using DAO .This Database created need to be accessed by ADO. I was able to create the Database successfully using DAO .
I included "afxdao.h" file for this.
Now to access the Database using ADO ,I had to import
" msado15.dll ".After importing this Dll when the server is executed I am getting a error that "WINDOWS.H" is already included.When I remove this dll this error does not come but the ado objects could not be used to access the Database.
I want to use DAO and ADO both in same program.If it is possible,how can I rectify this problem ?
Thanx in advance for the help .
Regards,
yamini
Y.Yamini Devi
|
|
|
|
|
I recently start with Visual C++ and i made a new project from template "Win32 Console application" "a hello world application", now I would change the colors of the text, the cursor position and clear the screen, with other compilers I made this with "textcolor","gotoxy" and "clrscr()" respectively but with VC++ I don't know how can I do it.
Thanks
|
|
|
|
|
First, you get need handle to the console -
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
Check for INVALID_HANDLE_VALUE , but note that this handle can be 0.
A gotoxy can be written like this, using the SetConsoleCursorPosition call:
void GotoXY(SHORT x, SHORT y)
{
COORD pos;
pos.X = x;
pos.Y = y;
SetConsoleCursorPosition(hConsole, pos);
}
To change colors, check out the SetConsoleTextAttribute console API function:
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN |
FOREGROUND_BLUE | BACKGROUND_BLUE);
Clearing the screen is explained in the MSDN article "HOWTO: Performing Clear Screen (CLS) in a Console Application".
I've noticed diffeences in how colors are handled in win9x vs NT/2000. Backgrounds may 'bleed' to the next line in win9x. Also, console apps behave a little differently when closed under the two OSs.
Search the MSDN for "Console functions". Lots of neat stuff you can do.
|
|
|
|
|
|
I enumerate the encoders registered on my computer(such as:Cinepak Codec by Radius, MJPEG Compressor,DivXMPEG-4 Fast-Motion...).Then how can I select one of them (Such as DivXFast-Motion) to compress the timeline using DirectShow filters?
Note:
These encoder have the same CLSID(CLSID_AVICo),only FccHandler and FridenlyName are different.How to select one of them?
Thanks!
|
|
|
|
|
Hello everyone !
I'm a begginer programmer in Visual C++ world.
and I would like to know if I can use the directX library with the MFC.
I think I have to use the C but I'm not sure....
Thank you.
Fx
|
|
|
|
|
You can use C++ and MFC with DirectX. CodeProject even has a section about DirectX:
http://www.codeproject.com/directx/
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_printing_in_rich_edit_controls.htm
or simply go to index of your Visual C++ help and select CRichEditCtrl and printing.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Anybody could explain me how must I use SaveDC and RestoreDC functions? The problem is than after redrawing screen I am loosing memory (each 10 times it redraws I loose almost 5% memory)
I have this in a header file:
class CSaveDC {
public:
CSaveDC(CDC * dc) { sdc = dc; saved = dc->SaveDC(); }
virtual ~CSaveDC() { sdc->RestoreDC(saved); }
protected:
CDC * sdc;
int saved;
};
...inside OnDraw function...
{
CSaveDC sdc (pDC);
pDC->TextOut(25,-2,actual);
pDC->TextOut(25,-16,actual1);
pDC->SelectObject(CreateFont(15,0,0,0,FW_NORMAL,FALSE,FALSE,FALSE,
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
18,"Times New Roman"));
...more TextOut...
pDC->SelectObject(CreatePen(PS_SOLID,2,RGB(255,0,0)));
..some drawing functions (MoveTo, LineTo, etc)....
pDC->SelectObject(CreatePen(PS_SOLID,2,RGB(255,96,0)));
..some drawing functions (MoveTo, LineTo, etc)...
pDC->SelectObject(CreatePen(PS_SOLID,2,RGB(0,255,255)));
..some drawing functions (MoveTo, LineTo, etc)....
pDC->SelectObject(CreatePen(PS_SOLID,2,RGB(255,0,255)));
..some drawing functions (MoveTo, LineTo, etc)....
pDC->SelectObject(CreatePen(PS_SOLID,2,RGB(0,255,0)));
..some drawing functions (MoveTo, LineTo, etc)....
}
...OnDraw follows
|
|
|
|
|
The objects you create using CreatePen/CreateFont etc. are not destroyed when you call RestoreDC. They are no longer selected into device context, but still exist. You should declare them as local MFC objects (like CPen), and ensure that CSaveDC d'tor is called before their destructors - so CSaveDC object must be declared *after* CPens.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
OK, that was the solution. I've changed to:
In OnDraw function...
CPen m_pPincelR, m_pPincelN, m_pPincelA, m_pPincelM, m_pPincelV;
CFont m_pLetraP, m_pLetraG;
m_pLetraG.CreateFont(16,0,0,0,FW_SEMIBOLD,FALSE,FALSE,FALSE,
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
18,"Times New Roman");
m_pLetraP.CreateFont(15,0,0,0,FW_NORMAL,FALSE,FALSE,FALSE,
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
18,"Times New Roman");
m_pPincelR.CreatePen(PS_SOLID,2,RGB(255,0,0));
m_pPincelN.CreatePen(PS_SOLID,2,RGB(255,96,0));
m_pPincelA.CreatePen(PS_SOLID,2,RGB(0,255,255));
m_pPincelM.CreatePen(PS_SOLID,2,RGB(255,0,255));
m_pPincelV.CreatePen(PS_SOLID,2,RGB(0,255,0));
{
CSaveDC sdc (pDC);
pDC->SelectObject(m_pLetraG);
pDC->TextOut(25,-2,actual);
pDC->SelectObject(m_pLetraP);
..more TextOut...
pDC->SelectObject(m_pPincelR);
...drawing functions...
pDC->SelectObject(m_pPincelN);
...drawing functions...
pDC->SelectObject(m_pPincelA);
...drawing functions...
pDC->SelectObject(m_pPincelM);
...drawing functions...
pDC->SelectObject(m_pPincelV);
...drawing functions...
}
... OnDraw follows...
And it works fine, I've tried to redraw many times and there is not memory consumption.
Thanks, so much.
|
|
|
|
|
Oh, a little problem. It works fine, but when I try to make a print preview I get a debug assertion failed, in the first SelectObject and TextOut function. If I try to print it without preview, it works.
Any idea?
|
|
|
|
|
LPSTR pszText;
CString sbuffer;
pszText = sbuffer;
how can I make the last line work? how to cast?
|
|
|
|
|
pszText = sbuffer.GetBuffer();
Now the pszText 'owns' the CString until you call ReleaseBuffer();. By the way, if you're doing this to turn a CString into a pszText for a function, the CString should cast to a char array by itself.
Christian
#include "std_disclaimer.h"
|
|
|
|
|
You can use the CString::LPCTSTR operator as follows
LPSTR pszText;
CString sbuffer;
//No copy takes place only pointer is returned
pszText = (LPCTSTR)sbuffer; //This returns a pointer to a Null terminated 'C' String
But beware if you change the CString there will be a reallocation of existing memory which will invalidate pszText
-----------------
Atul
#ifndef C
#define C damn_powerful
#endif
|
|
|
|
|
You can use the CString::LPCTSTR operator as follows
LPSTR pszText;
CString sbuffer;
//No copy takes place only pointer is returned
pszText = (LPCTSTR)sbuffer; //This returns a pointer to a Null terminated 'C' String
But beware if you change the CString there will be a reallocation of existing memory which will invalidate pszText
-----------------
Atul
#ifndef C
#define C damn_powerful
#endif
|
|
|
|
|
How can I be notified about any changes in Effects tab in Display Properties dialog box (e.g. checking/clearing "Animate Windows, Menus And Lists" check box)? I was under the impression that the system must send WM_SETTINGCHANGE message, but this doesn't happen in fact. Any ideas?
Thanks in advance.
Regards,
Nikolay
|
|
|
|
|
You could try monitoring their respective registry entries, I'm not sure what the keys would be but you could easily find out using a registry monitor (you can find a good one at www.sysinternals.com)
Have a good one,
-Ben
"Its funny when you stop doing things not because they’re wrong, but because you might get caught." - Unknown
|
|
|
|
|
Please, I need to know how I can do the allocation from CByteArray objects to CStatic objects and vice versa. My problem begins when I want to work with the image fields (of CByteArray style) of a DAO database and to show these fields through the CStatic members of dialog boxes.
If somebody knows other way to be able to operate with images in the database (insert, show and delete them) and in the dialog boxes, please tell me know.
Thanks a lot and I`m sorry for my English.
Jose Luis
|
|
|
|
|
if I want taht my CDialog will be exactly in the size of the screen.
and will be suitable for any computer(screen 17, 15 and every size)
|
|
|
|
|
Why ???
|
|
|
|
|