|
1: Search the articles here for Shell_NotifyIcon .
2: Look up the WM_DEVICECHANGE message and any KB articles associated with it.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
|
Hi,
I created a simple DLL which is executed from IIS through a webpage. Could anyone one tell me why I can't create a window in this DLL. I'd like to create a window, render something on it then grab the image and send it back to the client through IIS. The moment I issue a CreateWindow call and run the dll from a browser it hangs.
Sam.
|
|
|
|
|
I have linked dynamic linked library myfunctions.lib file in my project by setting its path in Project/Settings/Link/Input. And I have to place myfunctions.dll either in the same folder of my project's exe or in the system directory.
Can any one suggest me what should do ? if I want to place that myfunctios.dll in some other folder??
|
|
|
|
|
chandni_chandrakant_maheta wrote: Can any one suggest me what should do ?
About what?
chandni_chandrakant_maheta wrote: if I want to place that myfunctios.dll in some other folder??
What other folder?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Add the folder path into the Additional Include Directories in the project settings.
« Superman »
|
|
|
|
|
chandni_chandrakant_maheta wrote: And I have to place myfunctions.dll either in the same folder of my project's exe or in the system directory.
Either one will work normally. I would suggest in the EXE's local directory, just to make sure you do not mess up any other application that might be using the same DLL (if not an internal DLL) - if you having questions about something like this, dicking around with the Windows/System directory is a bad idea.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
but my requirement is such that I need to make one folder in my project's exe's path, and I need to place myfunctions.dll in that folder. Doing so, it gives error tha "dll not found" and terminates the application.
|
|
|
|
|
I tried out this, but it works in case we want to include lib or header files. In case of dll it does not work. Still it gives me the error that "dll ot found. ReInstalling the application may fix this problem."
|
|
|
|
|
then you will need to explicitly specify the path to that folder. For example, if your application is in C:\SomePath\ and the folder containing the DLL is called Modules , you will need to pass the complete path to LoadLbrary(...) - C:\SomePath\Modules\MyLibrary.dll .
You can call ::GetModuleFileName(...) (I think) to get the complete path to the Executable, remove the executable name, and append the DLL's subdirectory and name onto it, and you have a complete path to the DLL.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I am a final year student designing some software to analyse hard discs. I am trying to perform read/write operations on an external drive connected to my computer through a usb port. I have used the CreateFile function to get a Handle to the drive, i then use this handle as a parameter in the ReadFileEx function (to read the data) but i get a message box from Windows telling me 'this program needs to close', beacause of an access violation. I believe all the permissions etc are set correctly, and would appreciate some advice. The hard disc i am attempting to read on and write to is a master disc from another computer, so it will have OS stuff FAT tables etc, and i think it may be this My Windows dosn't like. Like i said earlier this is part of my project for uni so the quicker i can get past this problem the better. Thankyou in advance. Craig.
-- modified at 10:07 Monday 22nd January, 2007
Craig
|
|
|
|
|
How are you using CreateFile() and ReadFileEx() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thankyou for your interest. Please see my reply to the other guy for the code.
Craig
|
|
|
|
|
Big CDF wrote: I have used the CreateFile function to get a Handle to the drive, i then use this handle as a parameter in the ReadFileEx function (to read the data) but i get a message box from Windows telling me 'this program needs to close', beacause of an access violation
That sounds like a problem with the memory you are reading into, as opposed to how you are opening/reading the physical drive. Permission problems rarely directly result in access violation exceptions, and are more likely to just cause function-level failures. Oh, and you are paying attention to return codes, right?
Please post the snippet that opens the drive, specifies the memory to read drive information into, and the call that does the actual read.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I think the problem is with the readfile function. I am trying to read the first byte of the disc.
<pre>
include <windows.h>
#include <winioctl.h>
#include <stdio.h>
int main(void)
{
HANDLE hDevice; // handle to the drive to be examined
char buf[8];
hDevice = CreateFile("\\\\.\\i:", // drive to open
GENERIC_READ | GENERIC_WRITE, // access to the drive
GENERIC_READ | GENERIC_WRITE, // share mode
NULL, // default security attributes
FILE_FLAG_OVERLAPPED, // disposition
0, // file attributes
NULL); // do not copy file attributes
if(ReadFileEx(hDevice,buf,1,NULL,NULL))
{
printf("%s",buf);
}
CloseHandle(hDevice);
return (0);
}
</pre>
Craig
|
|
|
|
|
Big CDF wrote: FILE_FLAG_OVERLAPPED, // disposition
Where is your OVERLAPPED structure?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I was under the impression i shouldn't use one if the object i was accessing is anything other than a file. I know that sounds daft since im using 'create file' function. Is that wrong? Thanks for help once again.
Craig
|
|
|
|
|
Big CDF wrote: I was under the impression i shouldn't use one...
Then don't tell CreateFile() that you are using one.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Origionaly i wasn't, that was just a desperate attempt to get some results. Thanks for your help i'll investigate a bit deeper and hopfully be succsessful. Thanks again.
Craig
|
|
|
|
|
Big CDF wrote: hDevice = CreateFile("\\\\.\\i:", // drive to open
GENERIC_READ | GENERIC_WRITE, // access to the drive
GENERIC_READ | GENERIC_WRITE , // share mode
NULL, // default security attributes
FILE_FLAG_OVERLAPPED, // disposition
0, // file attributes
NULL); // do not copy file attributes
First, I would replace the share mode parameters with FILE_SHARE_READ | FILE_SHARE_WRITE , if you specify the FILE_FLAG_OVERLAPPED flag, you must to pass an OVERLAPPED structure to ReadFile(...) /ReadFileEx(...) , and that might be causing your crashes.
You do not need the overlapped flag to use physical drive or direct partition access.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Big CDF wrote: GENERIC_READ | GENERIC_WRITE, // access to the drive
GENERIC_READ | GENERIC_WRITE, // share mode
You are passing same flags (i.e. GENERIC_READ ) as share mode flags.
Big CDF wrote: if(ReadFileEx(hDevice,buf,1,NULL,NULL))
Have checked hDevice value after call to CreateFile .
|
|
|
|
|
In addition to what's already been said, you must read and write a complete sector at the time, else you will get an error.
In order to get the actual sector size, have a look at this sample: http://msdn2.microsoft.com/en-us/library/aa363147.aspx[^]
pdg.BytesPerSector contains the actual sector size.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
write an OOP-based software for a local publisher to generate of the score tally for each football team.
The menu-driven program is to read in the details of teams and also the various match scores from text files or equivalent according the format stated on page 2. Then the program should able to generate the various team scores and display the score tally of the choice of user of either a single individual team or the entire group. The format of the score tally is as follows:
Team Name P W D L F A Pts
which Team Name is the name of team,
P indicates the number of match records entered for the team,
W shows the number of win,
D depicts the number of draw,
L exhibits the number of loss,
F gives the total number of balls entered ‘for’ the team
A views the aggregated number of balls entered ‘against’ the team
and Pts consolidates the point system of each match score of 3 points for a win,
1 for draw and 0 for loss.
For team group display, there is a ranking system among the teams with the team awarded with the highest points (Pts) on top and follows by the rest of the teams in descending order of the points. If there are more than one teams having equal points, then the deciding factor is based on the goal difference which is the difference of ‘for’ (F) and ‘against’ (A).
For the OOP requirement, design the program and implement using two base classes, TEAM and MATCH with the necessary data members and the respective member functions. You may use a derived class, SCORE, basing on the two base classes for the data of the score tally for each team.
You may refer to page 2 and 3 for the sample displays for some details of requirement.
Please exercise creativity and object oriented approach in your program design and make your program as friendly as possible to the users.
The user input format and an example for TEAM details are as follows:
User Input Format Example
No of teams 4
Team 1 Code, Team 1 Name FRA, France
Team 2 Code, Team 2 Name SUI, Switzerland
Team 3 Code, Team 3 Name KOR, South Korea
…. Last Team TOG, Togo
The MATCH details are as follows:
User Input Format Example
No of Matches 6
1st match Score FRA - SUI 0
2nd match Score KOR - TOG 2:1
… FRA - KOR 1:1
TOG - SUI 0:2
TOG - FRA 0:2
SUI - KOR 2
The sample displays are as shown below (user inputs are in bold and underlined):
Sample Display 1: Displaying the Individual Team Score
Main Menu of the Football Score Tally Program
[1] Read in the Team and Match Details
[2] Display Individual Team Score
[3] Display Entire Group Score
[4] Quit the program
Choice? 2
Displaying the 4 teams and the respective 3-letter coding:
France: FRA Switzerland: SUI
South Korea: KOR Togo: TOG
Please enter the 3-letter team code: FRA
Number of the matches played by the France team is 3
Match [1]: France drew with Switzerland 0
Match [2]: France drew with South Korea 1:1
Match [3]: France won Togo 2
The score tally of France team is
P W D L F A Pts
France 3 1 2 0 3 1 5
Sample Display 2: Displaying the Entire Group Score
Main Menu of the Football Score Tally Program
[1] Read in the Team and Match Details
[2] Display Individual Team Score
[3] Display Entire Group Score
[4] Quit the program
Choice? 3
P W D L F A Pts
Switzerland 3 2 1 0 4 0 7
France 3 1 2 0 3 1 5
South Korea 3 1 1 1 3 4 4
Togo 3 0 0 3 1 6 0
***********************************************************************************************
can somebody help me please ?
|
|
|
|
|
1: This is not Rent-A-Coder.
2: Even if it was, I see no cash offering for doing work for you.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
It seems to be your homework. Do you homework and learn programming.
Greetings from Germany
|
|
|
|