|
Hi there
I am in need for the following information.
1. Any specific link where i can find info for writing Device-Drivers on Win NT.
2. Link where PCI bus access on Win NT is explained.
thanks in advance...
Bhaskar...
___________________________
When a thing is new, people say, "It's not true." Later, when its truth becomes obvious, people say, "It's not important." Finally, when its importance cannot be denied, people say, "Well, it's not new."
|
|
|
|
|
Hey there everyone,
I am a new member of the forum and relatively new to MFC. What I like to know how to create a graphical background and button.
If anyone can gave a specific example or link that will help, it will be very apperciated.
Thanks,
|
|
|
|
|
See if either of these help:
http://www.voidnish.com/articles/ShowArticle.aspx?code=bmpdlg01
http://www.flounder.com/bitmapbutton.htm
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hello all!
I have a project designed with the MFC document/view architecture. In the App idle time I read some data from a data source (I call a function of my doc class). This data will be displayed in a chart.
But I need also to make some computation on this data but I want to make this in a separate thread (the computation take some times and it cannot stop the reading of the data).
When I start the new Thread, I pass a pointer to my document so it can access data and the data will be stored in a buffer (FIFO buffer).
I was wondering if this is safe to do such a thing ?
Something like that:
BOOL CMyAppDoc::idle()
{
pFIFOBuffer->AddData(Data);
}
And in the thread function:
pMyDoc->ComputeData();
void CMyAppDoc::ComputeData()
{
while (TRUE)
if (pFIFOBuffer->GetData(Data))
ProcessData(Data);
}
Thanks
|
|
|
|
|
Some tips:
You must use code to protect multiple multithreading access to any shared data, like critical sections:
CRITICAL_SECTION cs;
InitializeCriticalSection( &cs );
...
EnterCriticalSection( & cs );
shared data access
LeaveCriticalSection( & cs );
You can also use Event primitives to signal end processing, like: CreateEvent, SetEvent, ResetEvent and WaitForSingleObject.
Good luck
GuimaSun
www.nexsun.com.br
|
|
|
|
|
Thanks !
Yes I think I will use the critical section, that's easy to use and fit perfectly with my needs.
Thanks
|
|
|
|
|
Hi,
I want to put in a site links that would start my application. Something like yahoo has in the profile pages:
ymsgr:sendIM?yahoouser
I know how to make a handle that will send the call to my app using something like myapp:command?parameter but what do I have to do in my app to catch that command and get the parameter?
Thanks
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
Hi
I would like to palce a check mark for menu item, if user clicks a menu item. I would like to do this from CMainFrm class.Can u please give me an idea?
Thanks
JP
|
|
|
|
|
You have to have a function that would execute the code when the users selects the menu item.
Let's say it's
ON_COMMAND(ID_YOURMENUITEM, TestFn)
Maybe you want to use a global variable that will tell you the state of that item.
bool testVar;
void TestFn() {
CMenu *m_MainMenu;
// let's say you have your menu in m_MainMenu
if (testVar) {
testVar = false;
m_MainMenu->GetSubMenu(1)->GetSubMenu(x)->CheckMenuItem(n, MF_BYPOSITION | MF_UNCHECKED);
} else {
testVar = true;
m_MainMenu->GetSubMenu(1)->GetSubMenu(x)->CheckMenuItem(n, MF_BYPOSITION | MF_CHECKED);
}
}
where n is the position of your item in the menu
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
Hey
In above example, m_MainMenu is unreferenced..so that code is not working. How to attach my Mainmeu to this?
Thanks
JP
|
|
|
|
|
I told you that m_MainMenu is your menu. You will have to replace it with your variable.
If it's the apps menu then you have to do something like this
m_MainMenu = GetMenu();
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
|
Use the ON_UPDATE_COMMAND_UI message if possible.
...
ON_UPDATE_COMMAND_UI(IDM_YOUR_MENU_ITEM, OnUpdateYourMenuItem)
...
void CMainFrm::OnUpdateYourMenuItem(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck( IsMenuItemCheck() );
}
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I am reading from 2 datafiles with three entries:
File 1:
--------
abc
def
ghi
--------
file 2: has an extra blank line after ghi
---------
abc
def
ghi
--------
If I have an ifstream object 'fin' and I do
char val;
while (!fin.eof())
{
fin >> val;
cout << val;
}
For file 1 I get the output as
abc
def
ghi
as expected.
But for file 2 I get
abc
def
ghi
ghi
1.Why is this?
2.How can I prevent it from processing any extra blank lines?
thanks,
ns
|
|
|
|
|
Using getline() might help.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
use cin.get()....or create cstyle file operations...
create FILE*....
use fgetc(fp)....
|
|
|
|
|
Right, but you should probably direct this towards the OP, otherwise your suggestion will possibly go unseen.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi
I have created a property sheet and some property pages.
My property page is user details and to avoid one big dialog I used property pages to split it up so I have address on one page contact info on another page and so on.
Can my pages access the sheet in any way?
I want my sheet to provide functions to save and load my user details so that changes to any of my pages calls the functions provided by the sheet. This is much easier than saving and loading for each page. I could have a function called load() in my property sheet which I could then call from any property page.
Now I have one file to store all my user details in but one easy way is to have a separate file for each property page but that means having several files where I only had one before.
|
|
|
|
|
Anonymous wrote:
Can my pages access the sheet in any way?
* Try:
CMySheet *pSheet = ((CMySheet *) GetParent());
-OR-
CMySheet *pSheet = ((CMySheet *) GetOwner());
* And for your dialog in which you have the sheet, you can have:
CMyDialog *pDialog = ((CMyDialog *) GetParentOwner());
The reason I have answered the second one is if you want to access your sheet through your dialog, as pDialog->pMySheet , this could help!
- Nirav
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Assuming your property sheet has each page as a member, you should be able to pass data to each page on initialisation and read data back from each page before your property page closes using simple member functions defined for each page.
If in your case you have a user object, it can handle a single file for you which is how it should be done of course, and your property sheet can call the user object's load() function at initialisation, you then pass a pointer to the user object to each of your pages and they can read and modify data using the member functions the user object provides or you could just pass them the values of the user objects. Before your property sheet closes, it can then call the user object's save() function if any modifications have been made.
e.g.:
MyPropSheet.h:
CMyPropPage1 m_MyPropPage1
CMyPropPage2 m_MyPropPage2
MyPropSheet.cpp:
CMyUser myUser;
myUser.Load();
m_MyPropPage1.setUser(&myUser)
m_MyPropPage2.setUser(&myUser)
AddPage(&m_MyPropPage1);
AddPage(&m_MyPropPage2);
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|
|
How can I determine if a print job was not printed. (ie the printer was off or out of paper). Currently if the printer is off the usual mechanism put the job in the queue and the print manager askes the retry of cancel question. As this is for a stock control label, I need to know if it printed OK.
I do not need a complete solution, just a starting point as this is a new area for me. I do not have to much of a clue where to start looking.
The openprinter
StartDocPrinter
StartPagePrinter
WritePrinter
EndPagePrinter
EndDocPrinter
ClosePrinter
etc functions all gibe a good return code too.
Any pinters welcome
|
|
|
|
|
You need to examine the printer status functions.
You need to know which printer you sent your print jobs to,
and then get the printer status and the printer's jobs' status.
I have been puling my hair out trying to figure out how to detect the printer has some other problem than just 'offline', since most printer drivers do not update the printer status data with anything but the offline bit.
One thing I do, is to watch the printer's job count. If it does not decrease over time, then something is wrong with the printer, like it is sitting there out of paper.
If you are REALLY hard core, you can write something called a 'print monitor', and it can get between Windows and the printer drvier, and this can potentially detect that the printer is off or out of paper or some other types of errors.
Look at the functions EnumJobs and GetJob
|
|
|
|
|
Was refered to this url on experts-exchange. might help you save some of your hair.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;160129
tcss
|
|
|
|
|
Hi guys,
What is the equivalent in GDI+ of the MFC statement?
CBitmap bmp(<resourceid>);
I would like to load a resource bitmap in GDI+.
Best regards.
|
|
|
|
|
Try this,
http://tinyurl.com/3gn88
|
|
|
|