|
Use your right mouse button to click on the value, then select "copy value"
|
|
|
|
|
there's usually a little magnifying glass next to the short string display, in the debugger watch windows. clicking that will bring up a window (the "visualizer") with the full text.
|
|
|
|
|
Hi. Well.. I need to add some tooltips to my main window (CDialog).
So... I do this in OnInit
bool test21=TTC.Create(this);
theApp.tooltip=&(TTC);
m_but.MoveWindow(0,0,500,500);
bool test11=theApp.tooltip->AddTool(m_but,"Cool?");
TTC.Activate(TRUE);
and
BOOL MainDial::PreTranslateMessage(MSG* pMsg)
{
if (NULL != theApp.tooltip)
theApp.tooltip->RelayEvent(pMsg);
return CDialog::PreTranslateMessage(pMsg);
}
Appears a great button, but hint doesn't. Why? Any idea? Smthng that i'am missing? Huh?
|
|
|
|
|
Could it be that in your OnInitDialog the TTC variable, which is i assume a CToolTipCtrl a local variable? If so then when your OnInitDialog is done and returns, TTC will be deleted and its destructor also destroys the tooltip. Of course that you don't get a crash in PreTranslateMessage suggests this is not the case but it might happen. Try making your TTC a member of the dialog class if it is not and use that instance instead of storing a pointer at it.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Well.. My CToolTipCtrl is member of MainDial of course. And by the way i already made it work with this button, but now i have another trouble. I create lots of dynamic buttons, inside of MPictureBox.Create i write:
BOOL result = CButton::Create(lpszCaption,dwStyle,rect,pParentWnd,nID);
this->SetParent(pParentWnd);
theApp.tooltip->AddTool(this,"HM?!");
but once again it doesn't help. Hint doesn't appear. Any idea?
|
|
|
|
|
You probably need to relay messages received by your picture box also to the tooltip control not only ones targeted at your dialog box. Aside of that, no idea. Just out of curiosity, what was your first problem?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
My original problem was to make some sort of game. Jackal. It's a board game invented 30-40 years ago at MGU (principal university of Moscow). For now i made it, but it's possible to play it only for humans against humans on the same cpu (hot seat mode). (Later i plan to make net support and cpu gamers). If you want to see what i have done for now drop.io/shchepin/ release.rar (requires redistributable package for vs2008 sp1).
P.S. I intented with
BOOL MPictureBox::PreTranslateMessage(MSG* pMsg)
{
if (NULL != theApp.tooltip)
theApp.tooltip->RelayEvent(pMsg);
return CButton::PreTranslateMessage(pMsg);
}
Didn't helped... =(
|
|
|
|
|
What kind of a control is that picturebox?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Just like i said before, it's a CButton child.
|
|
|
|
|
Program for multiplication of two matrices.
/* Program for multiplication of two matrices */
# include <stdio.h>
# include <conio.h>
# define ROW 3
# define COL 3
void main()
{
int mat1[ROW][COL],mat2[ROW][COL],mat3[ROW][COL];
int i,j,k;
clrscr();
printf("\n Enter matrix mat1(%dx%d)row-wise:\n ",ROW,COL);
for(i=0;i<ROW;i++)
{
for(j=0;j<COL;j++)
{
scanf("%d",&mat1[i][j]);
}
printf("\n Matrix 1 is %d \n",mat1[i][j]);
printf("\n Enter matrix mat2(%dx%d)row-wise:\n ",ROW,COL);
for(i=0;i<ROW;i++)
{
for(j=0;j<COL;j++)
scanf("%d",&mat2[i][j]);
}
printf("\n Matrix 2 is %d \n",mat2[i][j]);
}
//Multiplication
for(i=0;i<ROW;i++)
for(j=0;j<COL;j++)
{
mat3[i][j]=0;
for(k=0;k<COL;k++)
mat3[i][j]+=mat3[i][j]+mat1[i][k] * mat2[k][j];
}
// End of multiplication
printf("\n The Resultant matrix mat3 is: \n");
for(i=0;i<ROW;i++)
for(j=0;j<COL;j++)
printf("\n %5d",mat3[i][j]);
printf("\n");
getch();
}
maine multiplication ke liye yeh code likha hai par issme koi logical error hai,jo main remove nahi kar paa raha hoo..plzzz help me..
modified on Wednesday, November 11, 2009 8:41 AM
|
|
|
|
|
nobody here is going to do your homework for you.
|
|
|
|
|
I'm not sure whether to laugh or cry.
Can you do this on paper? If not, then don't bother with trying to code it.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
42. Always. Don't bother calculating, the answer is always 42
|
|
|
|
|
You are smoking the wrong stuff. Try herbal tea.
|
|
|
|
|
Hello Forum,
I have an C++ Control (RichClient) which contains a .NET Infragistics UltraWinGrid Control. The UltraWinGrid Control isn't repainted correctly, if other controls like Topmenu / or other C++ Windows are displayed and closed on top of the UltraWinGrid Control.
Even for example embedded DateTime Controls in the UltraWinGrid Cells only repaint the parts they cover, if in the method AfterCloseUp parent.Invalidate(true) is called.
Which Strategy could help me out to ensure the repainting of the UltraWinGrid-Parts (in .NET) out of C++, which has been coverd by other C++ controls?
thanks a lot
Sebastian
|
|
|
|
|
Try responding to the underlying window's WM_ERASEBKGND message. That is, if the grid is in a dialog, respond to the dialog's WM_ERASEBKGND message, invalidating the grid there.
|
|
|
|
|
Background: I am an embedded 'C' programmer, with no windows development experience other than simple console applications using Win32. I have developed using classes but mostly in Java. Other than the ubiquitous "Hello World" using Windows Forms and C++, I have limited to no windows programming experience.
Problem:I have a project where I need to interface an embedded controller to a windows application. Ultimately I need to translate input from windows controls into a stream of serial characters. This stream is interpreted by the embedded controller to do "stuff". The serial interface here may be a "real" serial port, or through a USB-Serial converter cable.
I don't have the money to buy comm libraries, I am using the Visual Studio 2008 Express because it is free, and unless it is absolutely necessary, I am not interested in learning another language like C# or Visual Basic. It is difficult enough for a 'C' coder in the embedded world to transition into the windows world of C++. I don't understand the implications of using ATL vs. MFC vs CLR vs Win32, so please be gentle.
I have posed this question now a half a dozen other forums and keep getting references to Visual C++ 2005 or 2006 code that will not compile in the .NET vernacular (did I get the nuance correct?) Or admonishments to "Just use ___" (insert any of J#, C#, VB or PHP). What used to be a simple:"fputc(com1, "My String");" is now a multilayered, insulated, managed into obscurity onion of code.
If I understand it correctly, in the Win32 vernacular, there is a serial port class, that can be used to instantiate an object that has methods for determining if a port exists, setting port parameters (like BRPY- Baud rate and parity, and flow control) as well as mapping the "<<" and ">>" operators to accommodate inserting/retrieving objects (like a string) into the stream.
I have yet to see an example of code, written using Win32, that will demonstrate moving a single character to a serial port, using the Visual Studio 2008 toolbox.
I need to lean on the experience of more informed programmers for guidance and direction to help me to the next step. Any help or direction (even if it is an admonishment to "RTFM" as long as the requisite "FM" is given) would be greatly appreciated.
David
Melbourne, Florida
|
|
|
|
|
dk-info wrote: Problem:I have a project where I need to interface an embedded controller to a windows application. Ultimately I need to translate input from windows controls into a stream of serial characters. This stream is interpreted by the embedded controller to do "stuff". The serial interface here may be a "real" serial port, or through a USB-Serial converter cable.
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Thank you for the rapid response.
I used a portion of the code you presented to illustrate how to so simple serial output from a Win32 console application. I was able to create a Handle using this code:
#include <iostream>
#include <windows.h>
#include "serialPlay.h"
using namespace std;
int main(void)
{
HANDLE hCom;
DWORD dwRet;
hCom = ::CreateFile(
TEXT("\\\\.\\COM1"),
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
NULL);
if(hCom == INVALID_HANDLE_VALUE) {
cout << "Cannot open serial port COM1\n";
return PROGRAM_FAILURE;
} else {
WriteFile( hCom, "This is testfile", 16, &dwRet, NULL );
}
return PROGRAM_SUCCESS;
}
It compiles and runs using Visual C++ in Visual Studio 2008 Express, in a Win32 console project without error, and using another computer and Hyper Terminal set to 9600 Baud, N-8-1 it does indeed transmit the message "This is testfile".
Looking to do more, here is a followup question:
I had to replace the "_T" macro with "TEXT" to resolve a compiler error; what is the "_T" macro?
Thanks again for helping me with this question.
Cheers!
David
|
|
|
|
|
dk-info wrote: what is the "_T" macro?
It's declared in the tchar.h header.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Thanks for the help, now another question, using only the win32 console, how do you set the com port parameters?
The code you gave is the basis for setting up serial threads (if I understand it correctly) in a windows application. I am not yet ready to try to build a windows application that can interface to a serial port, I would need an example application, tailored for Win32 that will illustrate accessing these comm resources from within the application.
I don't understand enough to solve the compiler errors when I try to piece your excellent tutorial code using the Visual Studio C++ express 2008 environment and Win32.
Would you be so kind as to give a complete example of an application that can send serial characters to a com port and receive them also?
Thanks again for the excellent tutorial,
David
|
|
|
|
|
Hello
I am developing window based web application.
I want to put restriction like ,No body can capture my application's screen with any tool .
Please suggest is it possible ?
if Yes,please suggest the way to do this.
Thanks
mahendra
|
|
|
|
|
You can't.
--
Miguel A. Vilariño
Software Developer
|
|
|
|
|
Hook the function responsible for screenshotting.
EDIT: oh sorry, I didn't notice the "web application" part of that.
modified on Tuesday, November 10, 2009 11:31 PM
|
|
|
|
|
OK,I changed idea.
Now I am creating desktop application instead of web application which needs to block print screen and screen capture. The print screen can be blocked by registering the hot key but now i am trying to find any message/method called on application when other applications try to grab pixels from its window. I am trying to do this in VC++
Is it possible?
Thanks
Mahendra
modified on Tuesday, November 10, 2009 2:10 AM
|
|
|
|