|
i see some program when login dialog end and follow a image that is fit for the application program content coming out for a while,but i dont know how to realize it,please give me some instruction ?thx all
|
|
|
|
|
I think what you are looking for is a splash screen. Try searching splash screen in codeproject. It is by the way not difficult to write your own.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
in my dialog there is a net address i want to realize hyperlinker when clicking it,if i dont write class specially for it,is there a more simpler way to solve it?
|
|
|
|
|
|
such as :extern CDatabase db;
CString sql1,sql2;
....
sql1=" ....";
db.ExecuteSQL(sql);
.....
sql2="...";
db.ExecuteSQL(sql);
....
|
|
|
|
|
You can call as many ExecuteSQL statements as you like given that the sql is a valid sql statement.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hello All, I have client and server programs. They used NamedPipe to communicate.
Here little bit about what each program does.
Server:
- has 2 buttons, print and stop
- Once the print button get pressed, create the thread and call the thread function.
here the thread function,
<br />
UINT PrintingThreadFunction(LPVOID lParam)<br />
{ <br />
CServerDlg *s = ((CServerDlg *)lParam);<br />
s->m_smain.OpenNewPipe(); <br />
while(!stopprinting)<br />
{ <br />
s->m_smain.ClientPrinting();
if(stopprinting == (int)YES)<br />
{<br />
s->m_smain.CloseThePipe(); <br />
break;<br />
}<br />
} <br />
stopprinting = (int)NO;
return (0);<br />
}<br />
The ClientPrinting() calls ConnectNamedPipe() which waits for the client to connect and then once the client connect to the pipe, it returns.
Client:
Client gets the file name from database and print it out. Then send the file name to Server using the same pipe.
Server has no problem Client's getting connected and sending a printed file name for 9 times. But at 10th time, Server get error message at ConnectNamePipe() which is
Unhandled exception at 0x0043e4cb in Server.exe: 0xC0000005: Access violation reading location 0x000000e4.
How can I eliminate this error?
I am thinking of using PostMessage(). But how the program also listen to the user click on Stop button?
Is stopping what the programs is doing for 10 seconds so the user can click on the quit button will help?
Thank you
|
|
|
|
|
I am thinking of using PostMessage(). But how the program also listen to the user click on Stop button?
Not sure of what the "stopprinting" is but would suggest to use event instead like this
<br />
if(WaitForSingleObject(<br />
yourStopEventHandle,<br />
INFINITE<br />
)== WAIT_OBJECT_0)<br />
{<br />
}<br />
check the event tutorial avail.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Having trouble getting this to work.
Need to control backlight level of LCD display.
Followed instructions for IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS and not getting any errors, but not getting any 'levels' back either.
Has anyone else tried using this API yet?
|
|
|
|
|
Hi !
I have to variables of type long. now i need to exponent the first with the second and then modulus a third long. how can i realize this ???
please Help
MFG
RedDragon2k
Unix and C are the ultimate computer viruses.
Visit me: www.programming.info.ms
|
|
|
|
|
long value = pow(long1, long2) % long3;
you need to include <math.h>
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thx. But when i compile it i get the following error :
'%': Illegal, left operand has type 'double'
Unix and C are the ultimate computer viruses.
Visit me: www.programming.info.ms
|
|
|
|
|
MSDN says: The modulus operator (%) has a stricter requirement in that its operands must be of integral type.
just cast the pow() function to a (long)
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Try this...
long value = ((long)pow(long1, long2)) % long3;
Jeremy Falcon
|
|
|
|
|
I suggest you do it manually with repeated multiplings and the apply the modulus
gabby
|
|
|
|
|
I am creating a small application that is going to run on a network. I need to know the number of people that are running the application on the network. I had tried looking for an example on how to this but I can’t find any. Any help!!!
|
|
|
|
|
When the application is started, you could simply write a "counter" number to some file. There are obviously lots of implications in doing this, but it is simple.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
HMODULE hm = LoadLibrary("http://some.server.net/downloads/a.dll");
Of course I know that the above does not work. Implementing the HTTP part is no problem, but how do I simulate LoadLibrary without an actual file?
(storing the downloaded DLL in a temporary file is not an option, I want real "zero footprint")
|
|
|
|
|
when i need cast cstring into float , i always use sscanf(mystr,"%f",ftype)//float ftype
fype=atof(mystr)
but which is better ,what is the difference between them?
|
|
|
|
|
atof() will be faster because it does not have to parse a format string like sscanf() does.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
atof is faster and smaller since it does not have the overhead of a format string scanner - I would think that sscanf calls atof when it finds the %f in a format string. FYI, you are not doing a cast, you are doing a conversion.
Steve
|
|
|
|
|
hi:i create a dialog such as CMyDlg, i define a variable :CBrush m_brush,
then i in onInitDialog :m_brush.CreateSolidBrush(RGB(255,255,0))
then HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd->GetDlgCtrlID() == IDC_STATIC)
{// Set the text color to red
pDC->SetTextColor(RGB(255, 0, 0));
// Set the background mode for text to transparent
pDC->SetBkMode(TRANSPARENT);
// Return handle to our CBrush object
hbr = m_brush;
}
return hbr;
}
but the text color is not i expected,and at the back of the text ,always exist white ?how to modify?but if i do these work in main dialog ,all is ok.
|
|
|
|
|
Seems brushing is ok, so it should work. Though I want to point out two things;
1) Do not use pWnd->GetDlgCtrlID() == IDC_STATIC condition unless you assign a unique id to a static control (e.g. IDC_MYSTATIC). Instead, if you want to consider all the static controls, test against nCtlColor == CTLCOLOR_STATIC.
2) Why not to set the text color;
pDC->SetTextColor( some rgb );
--
=====
Arman
|
|
|
|
|
|
Hi
modified 12-Sep-18 21:01pm.
|
|
|
|