|
Nothing special is required. You may need to rebuild the .clw file, however.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hmm, I tried this but no joy so far. I've added Cedric Moonens CCHartCtrl files to my project and make use of them on a dialog with a graph. I know it all works properly, but for example where I have
CChartSerie* pLineSerieCol = m_ChartCtrl.AddSerie(CChartSerie::stLineSerie);
pLineSerieCol->SetName("Energy Data");
pLineSerieCol->SetColor(0x00ff0000);
at the "->" it refuses to pop up the available methods of the class. I've manually deleted the .clw file, tried rebuild all and also opened class wizard with the clw file missing to force it to rebuild and checked that the source files are all included, but no joy as yet.
I wonder if it is humanly possible to feel more like a muppet than I do today
|
|
|
|
|
ldsdbomber wrote: ...at the "->" it refuses to pop up the available methods of the class.
I've had this happen in a few instances where the method that I was currently in had not yet been added to the class. For example:
void MyClass:DoSomething( void )
{
CChartSerie* pLineSerieCol = m_ChartCtrl.AddSerie(CChartSerie::stLineSerie);
pLineSerieCol->SetName("Energy Data");
pLineSerieCol->SetColor(0x00ff0000);
} If the DoSomething() method had not yet been added to MyClass , then Intellisense would fail to work. This does not appear to be the case with you however.
ldsdbomber wrote: I wonder if it is humanly possible to feel more like a muppet than I do today
Only if you are you sprouting fur in odd places.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It's not easy being green.....
A small tribute to Jim Hanson who made us happy without computers, cell phones and other gizmos.
|
|
|
|
|
The default setting in IDE in VS2005 while creating a new project to Use Unicode Character Set. There are several functions that use TCHAR and the _T macros. Why is is that the default setting is set to unicode. Most of the applicaitons are written in such a way that it expands to unicode or single byte character set while _MBCS is defined.
|
|
|
|
|
tom groezer wrote: Why is is that the default setting is set to unicode
what is your problem exactly ? what would you have prefered instead ? ...and why ?
|
|
|
|
|
hi im trying to get my head around GDI+ as far as i can tell i can only use it in the main function.
With what i've done below the image shows up at first but when the window refreshes i.e (change the size of it)
the image disappears is not repainted.
main..
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
{
Graphics graphics(GetDC(hwnd));
Image* image = new Image(L"clock2alpha.png");
Bitmap bitmap(L"clock2alpha.png");
graphics.DrawImage(&bitmap, 0, 0);
}
GdiplusShutdown( gdiplusToken );
.....
im interested in displaying png images and how to access them outside the main method with GDI+
thank you
|
|
|
|
|
Because your code doesn't have a re-painting mechanism. The drawing code should be placed in a OnPaint() or OnDraw() handler, regardless of GDI or GDI+ rendering.
Best,
Jun
|
|
|
|
|
Lamefif wrote: as far as i can tell i can only use it in the main function.
Where did you get that idea?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hey Mark
i dont know what i did earlier but it keept crashing at runtime, when i put the code above in a method it was weird.
thank for your replies guys.
|
|
|
|
|
Lamefif wrote: keept crashing at runtime, when i put the code above in a method
hmm It was something else probably.
You can make GDI+ calls anywhere (of course, all the usual thread safety issues apply if you're
using multiple threads).
If you're using GDI+ extensively, you can do the GdiplusStartup() just once - main/winmain is
fine - and call GdiplusShutdown() just once after all drawing is done - just before returning
from main/winmain is fine.
If you have trouble in other functions you can always post related sample code here
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Whats the error and where you used your code?
|
|
|
|
|
Hi
Actually i have already ask this question but not get any setisfactory
ans.
My problem is that i want to upload a .doc file in mysql database ,
i am making my application in VC++ 60. Modal Dialog based(type)
It should be work like whenever we upload our resume in any job site.
problem is that in VC++ there is not any file field(in which a browse button is already atteched)
I use a button and write code for it to open window but using it
we can select only file name not whole path
Please any one told me how i can solve this problem
Regard's
Kaushik
|
|
|
|
|
Your table will need to contain a blob-type field. You would then copy the file's bytes to this field just like you would any other field. The fact that the bytes come from a file is irrelevant.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I have a console app that is called by another program. I would like my console app to run hidden, is there a way to achieve this ?
Thanks
Constantly "Saving the day" should be taken as a sign of organizational dysfunction rather than individual skill - Ryan Roberts[^]
|
|
|
|
|
::ShellExecute(NULL, "open", "theprog.exe", NULL, NULL, <code>SW_HIDE</code>);
|
|
|
|
|
Thanks tox, but I cannot modify the call to the console app (otherwise I would have done what you said, trivial, of course). I must hide the console app from within the app directly.
Constantly "Saving the day" should be taken as a sign of organizational dysfunction rather than individual skill - Ryan Roberts[^]
|
|
|
|
|
a console program cannot hide itself unfortunately (not that easily AFAIK at least)
|
|
|
|
|
Je le savais. C'etait juste pour persuader un collègue qui ne voulait pas me croire
Constantly "Saving the day" should be taken as a sign of organizational dysfunction rather than individual skill - Ryan Roberts[^]
|
|
|
|
|
|
If you have control of the Console App end you could make it a fake Console App i.e. make it a Windows App but don't create any Windows just use AllocConsole if and when you do want a Console to appear.
The difference between the two is just a setting in the PE Header stuff on the front of your executable which is picked up by the C Runtime to determine it's mode setting. If it determines it's bootstrapping a Console App it allocates a Console otherwise it doesn't. There are other differences, in IO for example, but they all boil down to different paths in the startup code of the CRT. There's nothing, for example, to stop a Console App creating Windows and doing GUI stuff. In fact many DirectX games are done this way. They start out running as Console Apps and bootstrap DirectX from there to take over the entire screen.;) Equally A Windows app may have no actual Windows and could even have a Console if it decides to create one. I do this lot for scratch/testing type apps.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Matthew Faithfull wrote: Equally A Windows app may have no actual Windows and could even have a Console if it decides to create one.
This sounds interesting. How would you call a console from a win32 app ?
Constantly "Saving the day" should be taken as a sign of organizational dysfunction rather than individual skill - Ryan Roberts[^]
|
|
|
|
|
First off you need to get yourself a Console and then you can use stdin and stdout as normal. Have a look here http://msdn2.microsoft.com/en-us/library/ms682528.aspx[^]
or you can use API calls like BOOL WINAPI ReadConsole( HANDLE hConsoleInput, LPVOID lpBuffer, DWORD nNumberOfCharsToRead, LPDWORD lpNumberOfCharsRead, LPVOID pInputControl );
I have a pretty much complete wrapper class for the Console API functions which I may post on CP at some point if anyone's interested.;)
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
What do you mean when you say cthe following
If you have control of the Console App end you could make it a fake Console App i.e. make it a Windows App but don't create any Windows just use AllocConsole if and when you do want a Console to appear.
I guess using ShellExecute shall serve the purpose.
|
|
|
|
|
Hi All,
I have created an application in vc++ using the Appwizard with some dialog in it but without help support.
Now I am in need of providing help msg for the controls in the dialog.So later added support for the help.
Somehow managed to provide the help popup using WinHelp.
Currently I am able to get the help popup message at the cursor position .
But I need to display it near the control, not at the cursor position.
FYI The code looks like this
//InputDialog.h
afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
//InputDialog.cpp
BEGIN_MESSAGE_MAP(InputDialog, CDialog)
ON_WM_HELPINFO()
END_MESSAGE_MAP()
BOOL InputDialog::OnHelpInfo(HELPINFO* pHelpInfo)
{
// TODO: Add your message handler code here and/or call default
CRect Rect;
CPoint XPoint,YPoint,CtrlPoint;
CWnd* pControl = GetDlgItem( pHelpInfo->iCtrlId );
//Get the coordianate of the control -Example Radio button in the Dialog
pControl->GetClientRect(&Rect);
pControl->ClientToScreen(&Rect);
XPoint=Rect.TopLeft();
YPoint=Rect.BottomRight();
CtrlPoint.x = XPoint.x;
CtrlPoint.y = YPoint.y;
//Assign the control coordinate to the mouse Position
pHelpInfo->MousePos = CtrlPoint;
DWORD dwContextID = pControl->GetWindowContextHelpId();
//Only proceed if it's not a static control
if (cControlID != 65535) //65535 is IDC_STATIC
{
AfxGetApp()->WinHelp( dwContextID ,HELP_CONTEXTPOPUP);
}
return CDialog::OnHelpInfo(pHelpInfo);
}
Also, I am not sure whether the GetClientRect together with ClientToScreen returns the control screen coordinate.
Please, can anybody help me ?
Thanks
Martina
|
|
|
|