|
public bool bFirstTime;
void Form_Load()
{
bFirstTime = true;
myFunction();
}
void myFunction()
{
while (1)
{
if( bFirst )
{
MessageBox::Show("Example", "Title");
bFirstTime = false;
}
}
}
Now it will be called only once
Величие Бога не может быть недооценена.
|
|
|
|
|
Do you want to show a message box after the form loads?
If so use the Form_Shown event and don't use the while (1) loop.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thank you very much last two post. And the first guy, I am using the vc++ ide, so i dont think it's c# 0.o
|
|
|
|
|
hi,
i want to make dialog based application (GUI) in vc++, to communicate to the multimeter through rs232 interface.
in which dialog, port configuration is there and read/write/close/open function is also there , i m new in the vc++.
so i want code for dialog based application.
|
|
|
|
|
|
Are you sure the best solution will be found posting and posting again your question int this forum?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
1. write "serial port" in the search box (at top of this page)
2. hit enter and look yourself
Please explain me why you havent DONE that?
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
KarstenK wrote: 1. write "serial port" in the search box (at top of this page)
2. hit enter and look yourself
Please explain me why you havent DONE that? OMG
Because I don't need it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
the message was for the initial asker of this thread.
I am really very curios about this kind of questions. Why the hell they dont search for themselfes?
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
1. write "serial port" in the search box (at top of this page)
2. hit enter and look yourself
Please explain me why you havent DONE that? OMG
(Reposted)
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Dear Friends,
I have created a system tray icon. i am using Visual studio 6.0.
This icon is working for a alarm application. Now what i want to do is i should show a pop up message when it is a alarm time.
For example when Network connection goes down we get message as "LOCAL AREA DISCONNECTED " .. I want same thing.. Can anybody please help me out...
Thanks in advance
|
|
|
|
|
You can either dynamically create and destroy a new window or you can pre-create a window and keep it hidden to show when the time comes.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
any help on code. actually as an an alarm i m opening a web browser. but user wants pop up also so i dont want to use one more window concept
|
|
|
|
|
No, simply use native Shell popups apis
|
|
|
|
|
an interesting link: http://www.codeproject.com/info/search.aspx?artkw=tray+icon&sbo=kw
(I used the search box)
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
MeghaJoshi wrote: Now what i want to do is i should show a pop up message when it is a alarm time.
If I understand you correctly, see if this is of any help.
"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
|
|
|
|
|
In a dialog, some edit controls become read only / normal at runtime based on some conditions.
When the edit is read only, I want to avoid focus to control.
When tab pressed I want to set focus to next editable control.
On Mouse click, focus should be in previous control only.
To do this what message should I handle?
I have DDXed edit controls to customized CEdit derived class.
Thanks
--
"Programming is an art that fights back!"
|
|
|
|
|
In Style of CEdit, u have Tab Stop. please uncheck Tab stop.
Величие Бога не может быть недооценена.
|
|
|
|
|
You have to remove the WS_TABSTOP style at runtime.
You could do this at the same time you're making the control read only.
Use CWnd::ModifyStyle[^] like edit.ModifyStyle(WS_TABSTOP, 0);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
It better to do tab stop at run time than doing statically.
Initially we can set the tab stop to 0 using the resource, but runtime changing is more useful as superman suggested. Full 5 for the answer
Величие Бога не может быть недооценена.
|
|
|
|
|
How do I create a Mailbox attached to an INet address provided by an Appache server
Bram van Kampen
|
|
|
|
|
here is the source code of create a bitmap from memory dc,
CRect rRect;
GetClientRect(rRect);
CDC *pDC = GetDC();
CDC MemDC;
CBitmap *pOldBMP = NULL;
MemDC.CreateCompatibleDC(pDC);
CFont *pOldFont = MemDC.SelectObject(GetFont());
CRect rCaption(0,0,0,0);
MemDC.DrawText(m_strText, rCaption, DT_CALCRECT);
ASSERT( rCaption.Width() >= 0 );
ASSERT( rCaption.Height() >= 0 );
if (rCaption.Height() < 16)
rCaption.bottom = rCaption.top + 16;
rCaption.right += 25;
if (rRect.Width() >= 16 && rCaption.Width() > rRect.Width() - 16)
rCaption.right = rCaption.left + rRect.Width() - 16;
if (m_MemBMP.m_hObject)
{
m_MemBMP.DeleteObject();
}
m_MemBMP.CreateCompatibleBitmap(pDC, rCaption.Width(), rCaption.Height());
pOldBMP = MemDC.SelectObject(&m_MemBMP);
HINSTANCE hInstResource = NULL;
hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(nID), RT_GROUP_ICON);
ASSERT(hInstResource);
HICON hicon = (HICON)::LoadImage(hInstResource, MAKEINTRESOURCE(IDI_ICON1), IMAGE_ICON, NULL, NULL, 0);
ASSERT(hicon);
//MemDC.SetBkMode(TRANSPARENT);
MemDC.FillSolidRect(&rCaption, RGB(0, 0, 122));
DrawState( MemDC.m_hDC, NULL, NULL, (LPARAM)hicon, NULL, 1, 0, 16, 16, DST_ICON | DSS_NORMAL);
// clear all alpha channel data
BITMAP bmMem;
if (m_MemBMP.GetObject(sizeof bmMem, &bmMem) >= sizeof bmMem && bmMem.bmBitsPixel == 32)
{
DWORD dwSize = m_MemBMP.GetBitmapBits(0, NULL);
if (dwSize)
{
LPBYTE pPixels = (LPBYTE)malloc(dwSize);
if (pPixels)
{
if (m_MemBMP.GetBitmapBits(dwSize, pPixels) == dwSize)
{
LPBYTE pLine = pPixels;
int iLines = bmMem.bmHeight;
while (iLines-- > 0)
{
LPDWORD pdwPixel = (LPDWORD)pLine;
for (int x = 0; x < bmMem.bmWidth; x++)
{
*pdwPixel++ &= 0x00FFFFFF; //why need this ???
}
pLine += bmMem.bmWidthBytes;
}
m_MemBMP.SetBitmapBits(dwSize, pPixels);
}
free(pPixels);
}
}
}
rCaption.left += 22;
MemDC.SetTextColor(RGB(0, 125, 0));
MemDC.DrawText(m_strText, rCaption, DT_SINGLELINE | DT_LEFT | DT_END_ELLIPSIS);
ReleaseDC(pDC);
=========
can someone explain the functionality of this sentence:
*pdwPixel++ &= 0x00FFFFFF;
why did need this??
thanks in advance...
|
|
|
|
|
xuplus wrote: *pdwPixel++ &= 0x00FFFFFF; //why need this ???
This line clears the alpha channel of the pixel (leaving RGB values untouched).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Is this the right way to do it... I am getting an complier error ..(type mismatch)
struct {
char flag,
unsigned char data[60],
}packet;
vector<unsigned char=""> vect_data;
int func(packet *p_packet)
{
vector.push_back(p_packet->data);
}
I think I am dng somehting horribly wrong can anyone help me to figure out whr I am wrong..... I want to store all the data in vector as data arrives....
Can I use vect instead of data array... ? and than pass vect to vect..if so can thn when I copy structure will vect data filled...or I have push the data.... Also does vect works eactly like array....?
Plz help
Thanks!!!
|
|
|
|
|
If what you're trying to do is store strings in a vector, here is what you have to do.
struct {
char flag,
unsigned char data[60],
}packet;
vector<string> vect_data;
int func(packet *p_packet)
{
vector.push_back(p_packet->data);
}
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|