|
See WM_KEYDOWN and WM_KEYUP and for load you can use of LoadImage if its bmp
|
|
|
|
|
Which bit do you need help with ? The key press is easy, to show images, a picture box works best. The LoadImage API will load a bmp, to load jpg/gif/png, you need to use GDI+. I have articles on this, if you are using VC6, you will have trouble, but the newer compilers have GDI+ built in. VC6 is unsupported, and you need an out of date SDK to make GDI+ work with it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
gigel007 wrote: How do I do to show a picture (.bmp)in a box...
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Just a general question on CreateEvent() and WaitForSingleObject()
Just looking for an easier method of waiting for an external event to take place.
I was using the following code:-
while(waiting)
{
Sleep(100);
ProcessMessages();
CheckForEvent();
}
void ProcessMessages()
{
CWinApp* pApp = AfxGetApp();
MSG msg; while(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
pApp->PumpMessage();
}
But has anyone came up with a class to implement the CreateEvent() and WaitForSingleObject() .
Its justs to save time in generating by hand the thread and other code to managed these items.
Andy.
|
|
|
|
|
I don't see clearly what you are looking for. What you do when you need to wait for an event is simply call WaitForSingleObject once the event has been created (with CreateEvent). Then, in another thread, when something happen and you need to signal it to the other thread, just call SetEvent.
|
|
|
|
|
Cédric,
The routine CheckForEvent(); is in a loop waiting for a variable to be set.
while(!stop)
{
g_pMainDlg->ProcessMessages();
if(g_pSharedMem->A1_vuhf1_t02.fields.A1_t02_word_1_time_status == timecode)
{
stop = true;
g_pTabDialog->m_cErrorMessage.SetWindowText("Finished WAITING for time status");
}
Sleep(200);
}
Would it be easier just to kick off another thread to wait for the condition, just display a message that the condition has NOT occured in the main thread?
Andy.
|
|
|
|
|
hi All,
I have one windows service which works with "system account".
In this I am trying to access the mapped drive(shared on n/w by some server).
Now here I got errors like access denied. So I tried following cases.
case 1:
I changed the service to start as an administrator.
My mapped N/W drive has full access to everyone.
I have specified UNC paths
result: Things worked.
case 2:
I changed the service to start as administrator account.
My mapped N/W drive which needs password and username which are different.
Here I have specified the credentials while mapping that N/W drive.
I have specified UNC paths
result: I was unable to access the shared drive.
My question is as I am running as admin, my service is running as admin , I have mapped N/W drive as admin and supplied needed credentials at the mapping time.
why my service is not capable for acesssing that drive?
NOTE: I have an idea of null credentials but I don't want nullaccess enabled for N/W share. so dont want to use that option.
vikram S
|
|
|
|
|
Hi,
in the app i'm writing i need to collect data from various sources,every hour.I want the user to be capable of consulting these data through graphs,and most of all, to consult all the data acquired up to now.So i need to load all the data at every app start.
Now,i would like to ask you about a good way to store and quickly load data.I mean,i know i can store data in a text file,but i'm concerned about how long it will take to load this huge archive text file after some years....
|
|
|
|
|
|
This is the a good point,actually the one i was looking for,but i had no idea cause i have few experience of that and so i asked to more expert people.
Sorry about this following silly question,but as i told i'm a newbie in that:can a database solve my problems?
Thanks for the reply,by the way!
|
|
|
|
|
Accius wrote: can a database solve my problems?
yes.
their whole reason for existing is to store large amounts of data in ways that make it easy to access and update that data.
|
|
|
|
|
OK.
Just a last question:how about the time to load the database,when it has grown a lot?Will it be better than the simple text file loading?
|
|
|
|
|
to "load" the database ?
you access a database records through SQL requests...
if the database get too huge, you can indexate some table columns that are used often to query data
|
|
|
|
|
you should only load the data that you actually need, when you need it. if you need to read everything into memory, then a database won't help you.
databases help organize data so you can get the relevant parts of the data when you need them, quickly.
|
|
|
|
|
Ok,again i thank you.
You helped me a lot
|
|
|
|
|
By the way...
Can i add database support in a dialog based application i've already written?
Or have i got to make a new application?
|
|
|
|
|
Do you want to use of Sql Server or Access you said every hour does data voluminous?
|
|
|
|
|
WhiteSky wrote: Sql Server or Access
why don't you propose Oracle also in your list ? oh, yeah, MS Centric.
but know that Access is not a database
|
|
|
|
|
But why I must suggest Oracle I preference use of Sql Server(products of Misrosoft)
|
|
|
|
|
i've been using both, but for very huge databases, MS SQL Server does strange things somethings (weird execution paths, way slow than oracle for same scheme...)
The problem of Oracle is the non friendly administration tools. MS produces good stuff for this ; but the main purpose behind that is the database, no ?
then my choice is done (i repeat, for huge databases !)
|
|
|
|
|
I have a tbl for COM application.
In the header file of the application - initInstance(),
CoInitializeEx(NULL,COINIT_MULTITHREADED); is called.
In the Dialog (normal MFC) creatinstance is called.
The classID is passed to the createinstance.
Then,
BOOL Ret = AfxConnectionAdvise(
<punksrc>,
DIID__IEvents ,
GetIDispatch(FALSE), //get the IDispatch assocaiated with Mainframe...
FALSE, //donod addref
&m_dwCookie);//cookie to break connection later...
}
But, while calling the above method, exception is trown in AfxConnectionAdvise.
Thanks
Thanks
Raji
|
|
|
|
|
RajiRaghu wrote: GetIDispatch(FALSE), //get the IDispatch assocaiated with Mainframe...
FALSE, //donod addref
&m_dwCookie);//cookie to break connection later...
}
Are you sure GetIDDispatch here is retunring non-NULL ?
|
|
|
|
|
m_pControl.CreateInstance("8fea0f92-1975-4a13-af9b-5666583843db");
m_pMonitor.CreateInstance("b4c8b90e-11c8-4f8b-81a0-a6bcb53d5c2a");
The first parameter of AfxConnectionAdvise - pUnkSrc is 0x00000000
pUnkSink - is not null.
- pUnkSink 0x0012fe34 IUnknown *
- [COleDispatchImpl] {...} COleDispatchImpl
- IDispatch {...} IDispatch
- IUnknown {...} IUnknown
- __vfptr 0x7c15957c const COleDispatchImpl::`vftable' *
[0] 0x7c2e5f80 COleDispatchImpl::QueryInterface(const _GUID &, void * *) *
[1] 0x7c2e5f40 COleDispatchImpl::AddRef(void) *
[2] 0x7c2e5f60 COleDispatchImpl::Release(void)
Thanks
Raji
|
|
|
|
|
RajiRaghu wrote: The first parameter of AfxConnectionAdvise - pUnkSrc is 0x00000000
That may be cause of exception.
|
|
|
|
|
The first parameter is from
m_pControl.CreateInstance("8fea0f92-1975-4a13-af9b-5666583843db");
m_pMonitor.CreateInstance("b4c8b90e-11c8-4f8b-81a0-a6bcb53d5c2a");
means that createInstance failed?
Please suggest altenatives..
Thanks
Raji
|
|
|
|