|
Hi everyone !
Is there any way to wait for a callback function like the HookProcs ?
Thanks in advance,
André Schmidt
|
|
|
|
|
Huh?
What do you mean by 'wait for a callback function'?
Do you want an indication when one is called?
(If so, the function could signal an event)
Do you want to wait until a callback has returned?
(doesn't this happen anyway?)
Steve S
|
|
|
|
|
Hi,
is there a simple way to set a PropSheet's background color?
and, how can you set that for a CTabCtrl???
thx
|
|
|
|
|
Hi!
With CreateFromFile() I am able to open an excel file in my ole
container application.
I want to embed excel sheet in my container applicatio and want to
display contents of a file, but i dont want to use CreateFromFile(), I
just want to pass raw data as input.
Which function shall I use,CreateFromClipboard() or CreateFromData().
I am running in Win2k and have office2k.
Thanks
Anshu
|
|
|
|
|
Hello,
I am a beginner in Embedded VC++ programming and am confronted with a problem :
I have a desktop connected to a PDA.I have to write a program to send data from the desktop which would be read and displayed by the PDA.Any suggestions on how to proceed with this is most welcome.
Thanks,
Deepa.
|
|
|
|
|
On the platform end (Windows), the software opens a port, sets the port settings, writes data and closes the port. On the receiving end (PDA), the program must first open the port, then create a listener for incoming data, and when the listener fires an event, read data from the port and close the connection.
Here is a lengthy article digging into the aspects of serial communication quite in-depth. It might be helpful to you: http://www.codeproject.com/system/serial_com.asp[^]
Here is a link to MSDN dictating the Serial Communication on WinCE[^]. I don't know what OS your PDA uses, but perhaps reading it will be helpful.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hello Antti,
Thank you for your kind response.My PDA uses Win CE.I have written a program in EVC++ to write a few characters to the COM1 port.Now I have no idea how to implement the read program in the PDA so that it can read the data being sent.
Thanks
Deepa.
|
|
|
|
|
Just follow the implementation guide from Microsoft for Windows CE to develop the application. You must have the port settings made similar. If you readed the first article I posted, a data structure is mentioned there with which you can set the port settings in the Windows end. See the Microsoft WinCE documentation for a respective setting on the PDA end.
I think versions of WinCE sport some type of MFC support, and thus you can use much of the same code to implement port reading on the PDA end. For this purpose, you would need to consult the PDA documentation and/or files to see what version of MFC it supports.
The most effective way is to use the Microsoft-provided WinCE emulator. This allows you to develop and test code on an emulator before sending it to the actual device. I think eVC++ supports on-device debugging through a serial connection. This is not very viable in your case, as you need the serial connection yourself. So use the emulator.
For an example, create the WinCE build, run it in the emulator, then start the Windows-end program, write data into the port and attempt to read it through the emulator. For an extremely effective method, if your computer supports two COM ports, you can write to the first using the Windows-program, then read from the second using the emulator-driven build. Just get a cross-connected serial cable (or build one yourself) to inter-connect the two ports.
Also, you should post this question into the Embedded / Mobile area, as most of the users who develop WinCE software tend to hang around there, and thus you might get more knowledgeable answers.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi
I made a service 'SRVANY' of a program i have written in MFC.
This works great using the login of the LocalSystem account.
Now here is the problem:
I'm using the localsystem account because i want to be able to have an interactive program .. The users logs in and can do some actions he want.
Let's say the program needs to write a certain file to a share located '\\ip\d-share\'. The user doesn't have the ability to get access to that share because it is using the LocalSystem account. Then i thought .. Oh i'll use a network account and the problem of the share will be solved. Indeed it was, but this made the program not be interactive with the desktop! And i don't want to loose that .... So i want to combine both advantages.
Is there a way around this or a good solution? The solution needs to work for Windows2000 computers too so not only old Windows NT versions.
I hope someone came across this problem too
Greetings,
JensB
|
|
|
|
|
One way this is often achieved is by having a service that uses any account, LocalSystem, or a specific account if you need network access. The service does not use a GUI, but processes requests received by some IPC mechanism, such as a named pipe or a socket.
The GUI is then run by a user on their desktop, and it communicates via the pipe or socket with the service. If necessary, the service can impersonate the client to acquire their access rights.
Often a socket is used in place of a named pipe because the named pipe needs to be accessible by everyone (generally), and many people don't understand how to construct an ACL to apply to the pipe.
Steve S
|
|
|
|
|
Well, the only reason i want to run a service out of the program is that the program needs to be able to start when the computer boots before the user logs in.
The program itself has a GUI!!
Greetings,
Jens
|
|
|
|
|
i tried the following but somehow the radio buttons do not work accordingly.
UpdateData (TRUE);
if(m_radio=0){
do this...}
if(m_radio=1){
{do this...}
if(m_radio=2){
{do this...}
i have 3 radio buttons grouped together.
|
|
|
|
|
I hope that your
if (m_radio = 0)
is a typo, and you've not forgotten that in C/C++ the test for equality is == ...
Steve S
|
|
|
|
|
As Steve has already indicated, it looks as though you have mistakingly used the assignment operator in place of the equality operator. If you will get in the habit of putting constants on the left side of either operator, the compiler would have gladly complained about these statements.
For example:
if (0 = m_radio)
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
How to show AVI file in a CDialog?
(what better way?)
thanks
|
|
|
|
|
use MFC class CAnimationCtrl
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
|
How do a grey a CListBox based on some option ,
say option A the ListBox should be enabled with Window color as bg
for option B, the listbox should be disabled with btn face color and all list items also greyed..like a greyed edit box
PS its CListBox not a CListCtrl
|
|
|
|
|
I don't know if I exactly understood what you want to do, but if you want to enable or disable the control you can use the EnableWindow() function, e.g.:
void EnableMyListBox()
{
myListBox.EnableWindow(TRUE);
}
void DisableMyListBox()
{
myListBox.EnableWindow(FALSE);
} When you disable the listbox it will be grayed out.
Hope it'll help!
Regards, mYkel
|
|
|
|
|
True, but I want the background to be greyed as well. If I do a fillrect with a brush (COLOR_BTNFACE), EnableWindow(FALSE) still causes it to have a white background even though the listbox is disabled.
|
|
|
|
|
See CWnd::OnCtlColor() documentation. I don't have experiences with it but, it could solve your problem.
Robert-Antonio
"CRAY is the only computer, which runs an endless loop in just 4 hours"
|
|
|
|
|
As another poster said you can use the OnCtlColor() method for this. Assuming you have a button for changing between the grayed and not grayed state like this:
void CListBoxGrayingTestDlg::OnButtonGray()
{
if(m_bGrayed)
{
m_bGrayed = FALSE;
m_MyListBox.EnableWindow(TRUE);
}
else
{
m_bGrayed = TRUE;
m_MyListBox.EnableWindow(FALSE);
}
} Adding a message handler for WM_CTLCOLOR you can now do something like this:
HBRUSH CListBoxGrayingTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetBkMode(TRANSPARENT);
if (pWnd->GetDlgCtrlID() == IDC_MYLISTBOX)
{
if(m_bGrayed)
return (HBRUSH)GetStockObject(GRAY_BRUSH);
else
return (HBRUSH)GetStockObject(WHITE_BRUSH);
}
return hbr;
} Now the background will be grayed, when the control is disabled...
Regards, mYkel
|
|
|
|
|
I don't understand the consequences between dialog on top and fullscreen application...
however, you should set the WS_EX_TOPMOST style in CDialog::CreateEx() .
Robert-Antonio
"CRAY is the only computer, which runs an endless loop in just 4 hours"
|
|
|
|
|
Thanks,
I just found i could select Overlapped from within the Properties page of the Dialog.
It probably does the same as your solution.
Best regards
Neok
|
|
|
|
|
Hi,
Iam in trouble rotating the bitmap.
Iam doing it as follows:
HBITMAP handle;
//Functin from which I get a handle
//to the Bitmap.
handle = GetBitmapHandle();
CDC dcMemory;
dcMemory.CreateCompatibleDC(pDC);
CBitmap *bitmap=CBitmap::FromHandle(handle);
BITMAP bm;
bitmap->GetBitmap(&bm);
//Rotating the Bitmap by 90.
XFORM xFormBarcode;
SetGraphicsMode(pDC->GetSafeHdc(),GM_ADVANCED);
xFormBarcode.eM11 = (FLOAT)cos(90*DEGREES2RADIANS);
xFormBarcode.eM12 = (FLOAT)sin(90*DEGREES2RADIANS);
xFormBarcode.eM21 = (FLOAT)-sin(90*DEGREES2RADIANS);
xFormBarcode.eM22 = (FLOAT) cos(90*DEGREES2RADIANS);
xFormBarcode.eDx = 0;
xFormBarcode.eDy = 0;
int xCord =0;
int yCord =0;
int x =abs((xCord*(FLOAT)cos(90*DEGREES2RADIANS)) + (yCord * (FLOAT)-sin(90*DEGREES2RADIANS)));
int y = (xCord*(FLOAT)sin(90*DEGREES2RADIANS)) + (yCord * (FLOAT)cos(90*DEGREES2RADIANS));
SetWorldTransform(pDC->GetSafeHdc(),&xFormBarcode);
CBitmap* pOldBitmap = dcMemory.SelectObject(bitmap);
double bmWidth = bm.bmWidth;
double bmHeight = bm.bmHeight;
pDC->BitBlt(100,100,bm.bmWidth,bm.bmHeight, &dcMemory, 0,0,SRCCOPY);
dcMemory.SelectObject(pOldBitmap);
I can't see the rotated effect.How Could I rotate it..
Any help is appreciated...
Thanks...
|
|
|
|