|
I've just run the same code on an old Win' 98 system and, indeed, it works perfectly.
It seems that it only fails under the Win' XP...
|
|
|
|
|
Using CreateProcess as documented[^] for 16-bit applications didn't help any?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
From the documentation on the lpApplicationName parameter (the first one):If the executable module is a 16-bit application, lpApplicationName should be NULL, and the string pointed to by lpCommandLine should specify the executable module as well as its arguments.
|
|
|
|
|
Ok, thank you. I will change the code as it is required.
|
|
|
|
|
my precedure would like to open a file which in another computer, but the computer has password, how to deal with that?
|
|
|
|
|
Knowing the login and password?
Is usual that net-resources have password, if not...
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?
|
|
|
|
|
I made a simple program which when you press the up key shows up, left key shows left etc.
But how can i make it work with two keys at once? Like up and right (which would then display up and right..)
Is there some not too hard way to do this?
thanks all!
(MS Visual studio 6, program is a windows console application with mfc)
//Johannes
|
|
|
|
|
AFAIK, you will get one event when a key is pressed and another event when the key is released.
Get those events and keep track of what key(s) are currently pressed.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
with what function do i get that?
ive tried _getch, but it only catches one of the keys as some keys some dominant over others.
thanks
//Johannes
|
|
|
|
|
WM_KEYDOWN or WM_KEYUP isnt helpfuls?
|
|
|
|
|
You may poll what keys are pressed by calling ::GetAsyncKeyState( <virtual key code> ) .
For virtual key codes you can use VK_LEFT , VK_RIGHT , VK_UP and VK_DOWN for the arrow keys.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
GetAsyncKeyState(); seems to work perfectly so far!
thanks all of you!!!
Just a quick question:
i can do int data = 0xF; but how do i do the same thing with binary?
//Johannes
|
|
|
|
|
Johpoke wrote: i can do int data = 0xF; but how do i do the same thing with binary?
In short: you can't.
You may write integer values in your source code using decimal, octal or hexadecimal notation.
For decimal notation you have no prefix and use digits from 0 to 9, e.g. 255 .
For octal notation you prefix the number with '0' and use digits from 0 to 7, e.g. 0377 .
For hexadecimal notation you prefix the number with '0x' and use digits from 0 to F, e.g. 0xFF .
Each example represents the same value but with different notations.
Regarding how to read and interpret the hexadecimal notation...
Each digit represents four bits, a nibble, which can hold values between 0 and 15. You simply have to get it into your spinal cord how to represent a nibble using the different notations, e.g. that 1100 in binary equals 0xC in hex which equals 12 in decimal.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi,
I am trying to notify the user about events of my application by placing an item in his outlook inbox. Unfortunately, up to now this is just a nice plan.
Is there a direct way to create pseudo-E-Mails in the Inbox? I cannot send a real e-mail, as notifcations have to be instantaneous.
It would be great if you could get me started somehow. I haven't programmed anything that accesses Outlook so far.
Thanks a lot.
Dominik
|
|
|
|
|
I have several Edit boxes in my dialog application..
Can any one tell me how to create tool tips for each of the edit boxes...
Proud To Be an Indian
|
|
|
|
|
|
m_ToolTip.Create(this);
m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_MIN),"Min Body Lenght");
m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_MAX),"Max Body Lenght");
m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_VAR),"Max Var Body Lenght");
m_ToolTip.Activate(TRUE);
I had given like this in my code -
where IDC_CC_BODY_LENGTH_MIN,IDC_CC_BODY_LENGTH_MIN,IDC_CC_BODY_LENGTH_VAR -are edit boxes - But the appln is running into a MEMORY ERROR , Why?
Proud To Be an Indian
|
|
|
|
|
Try to this code
void CDialogDlg::SetToolTip(LPCTSTR Text,HWND hwnd)
{
TOOLINFO ti;
ti.cbSize = sizeof(TOOLINFO);
ti.lpszText = (LPTSTR)Text;
ti.hinst = AfxGetInstanceHandle();
ti.hwnd = hwnd;
ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
ti.uId = (UINT) hwnd;
m_tooltip.SendMessage(TTM_ADDTOOL, 0, (LPARAM) &ti);
}
void CDialogDlg::OnBnClickedButton1()
{
m_tooltip.Create(this);
SetToolTip("Test",hwnd);
SetToolTip("Test2",hwnd2);
}
What happens?
|
|
|
|
|
Hi,
Drive from the CEdit class and create a new CEditTool class, which will support the ToolTip.
In Drived class CEditToolTip, have a member of type CToolTipCtrl. Create the Instance of this member in constructor, also u can set the ToolTipText Dynamically. And Finally in the MouseMove event u can call Update to display the tooltip.
Manoj
Never Give up
|
|
|
|
|
In my program i created an public variable
CToolTipCtrl m_tooltip in the *.h file of my prg.
WHen i changed the var declaration to protected the error was cleared
protected:
CToolTipCtrl m_tooltip;
Frndz For information there is an easy way to create tooltips {Bosses plz excuse its for beginners}
Projects->Add to Project->Components & controls ->Gallery->Visual C++ Components->ToolTip Support
Its DONE .. . so simple
Proud To Be an Indian
|
|
|
|
|
I am trying to change position of property sheet but i couldn't ,i tried with SetWindowPos(), it's returning 1 but position is not changing.
If anybody is having idea abt it pls let me know.
Thank You.
Sethuraman.K
|
|
|
|
|
Sethuraman.K wrote: i tried with SetWindowPos(),
Can you show your attempted code?
Prasad
MS MVP - VC++
|
|
|
|
|
//This is my code...
// Mypropertysheet.cpp : implementation file
//
#include "stdafx.h"
#include "freshpdk.h"
#include "Mypropertysheet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern int presentlyreading;
/////////////////////////////////////////////////////////////////////////////
// CMypropertysheet
IMPLEMENT_DYNAMIC(CMypropertysheet, CPropertySheet)
CMypropertysheet::CMypropertysheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
}
CMypropertysheet::CMypropertysheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
//AddPage(&fstpg);//Commected By Abhi on 170507
AddPage(&secpg);
}
CMypropertysheet::~CMypropertysheet()
{
}
BEGIN_MESSAGE_MAP(CMypropertysheet, CPropertySheet)
//{{AFX_MSG_MAP(CMypropertysheet)
ON_WM_CLOSE()
ON_WM_CREATE()
ON_WM_KEYDOWN()
ON_WM_KEYUP()
ON_WM_VKEYTOITEM()
ON_COMMAND(IDOK, OnOK)
ON_WM_ENABLE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMypropertysheet message handlers
void CMypropertysheet::OnClose()
{
// TODO: Add your message handler code here and/or call default
if(presentlyreading != 0)
return;
EndDialog(IDOK);
CPropertySheet::OnClose();
}
int CMypropertysheet::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CPropertySheet::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CWnd *pTemp;
pTemp = GetDlgItem(ID_APPLY_NOW);
if(pTemp != NULL)
pTemp->DestroyWindow();
if(pTemp != NULL)
pTemp->DestroyWindow();
pTemp = GetDlgItem(IDCANCEL);
if(pTemp != NULL)
pTemp->SetWindowText("Close");
return TRUE;
return 0;
}
void CMypropertysheet::OnCancel()
{
// MessageBox("hello");
// CDialog::OnCancel();
}
BOOL CMypropertysheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
CWnd *pTemp;
pTemp = GetDlgItem(ID_APPLY_NOW);
if(pTemp != NULL)
pTemp->DestroyWindow();
/////////// sujith 07-02-07 (delete) ////////////
//pTemp = GetDlgItem(IDOK);
//if(pTemp != NULL)
// pTemp->DestroyWindow();
/////////// sujith 07-02-07 ////////////
pTemp = GetDlgItem(IDCANCEL);
if(pTemp != NULL)
pTemp->SetWindowText("Close");
//////****/Here am changing the position of Propertysheet window
int i= ((CWnd*)this)->SetWindowPos((CWnd*)this ,1038,73,0,0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
//////****
return TRUE;
}
void CMypropertysheet::OnOK()
{
// TODO: Add extra validation here
//CDialog::OnOK();
//MessageBox("Hello");
}
void CMypropertysheet::OnEnable(BOOL bEnable)
{
CPropertySheet::OnEnable(bEnable);
// TODO: Add your message handler code here
}
Sethuraman.K
|
|
|
|
|
I should have mention "relevent code".
Sethuraman.K wrote: int i= ((CWnd*)this)->SetWindowPos((CWnd*)this ,1038,73,0,0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
You are using same window handle as hWndInsertAfter . Refer documentation for correct parameter.
And you are giving 0 and 0 as width and height of window. (Again, refer documentation)
Prasad
MS MVP - VC++
|
|
|
|
|
prasad_som wrote: I should have mention "relevent code".
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|