|
That is an external hardware device. So you will need to check with the manufacturer and find out if they provide any API functions or other tools to acquire this information.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
hmm, check to see if it appears as a camera device on your system - if so you could use DirectShow..
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Thanks all of u!!!
Can I use TWAIN or scanner drvier to get the image??
|
|
|
|
|
How could I override painting of a static control to put some extra text up in top left corner;
_______________
|f1 |
| Static Text |
|______________|
I want the control to draw normally then have my code add the "f1" text in there.
|
|
|
|
|
There are a number of ways that you can accomplish this, however I would recommend subclassing the edit control and overriding the WM_PAINT message.
You can do this by creating a new WndProc for your static control that handles the WM_PAINT message and sends all other messages to the CallWindowProc.
Then call SetWindowLong using the handle to your static control, and set the GWL_WNDPROC parameter. You will need to cache the value that is returned, because this is the value that you will pass into CallWindowProc in order to get the default static control behavior.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I want to learn from the scratch the concept of filing in C++(of course not using MFC) . Any good resource, then please tell me
|
|
|
|
|
Shah Shahdadpur wrote:
Any good resource, then please tell me
Yes, CodeProject.com
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Try the File I/O in the SDK of MSDN.
If your writing a Windows program why won't you use the MFC CFile in this case?;)
|
|
|
|
|
hi,
i was wondering if someone could please help me on a code using arrays. If there is a given date in a year how would i compute and print how many days have passed in that year and also to compute the next day.
For example, if the date was supplied 2/3/98. i understand the null terminator is suppose to be after the day, month and year? but the output should be 61. I also understand that leap years should be taken into account as well being they occur every 4 years.
So far i have determined that i need atleast 4 functions,.. CheckLeapYear, ComputeDays, PrintDays, ComputeNextDay, and PrintNextDate.
Thank you
|
|
|
|
|
I would create an array of 12 items, to represent each of the twelve months, and then in each item in the array I would place the number of days that are in that month.
After you determine which month the requested date is in, you would cycle through your array and add up all of the days until the current month, and add the number of days that have passed in teh current month. Then like you said account for the leapyear.
The other functions that you mentioned can be derived from your data in the month array that I described.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I'm playing "Spot the homework assignment". Want to join in?
Signature space for rent. Apply by email to....
|
|
|
|
|
Jon Hulatt wrote:
I'm playing "Spot the homework assignment". Want to join in?
True, that is why I was very careful to only give suggestions for design and no code examples
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I also understand that leap years should be taken into account as well being they occur every 4 years
IsLeap(LONG year) {
if ( ((year % 4) == 0) &&
(((year % 100) != 0) ||
((year % 400) == 0))) {
return TRUE;
}
else {
return FALSE;
}
}
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
What do the values in the lpdwFlags say after you call this function?
I have found that this function is mostly reliable. It will return true if you are connected to a LAN, and it will return TRUE if you are connected to the internet through a modem. But this does not tell you if your LAN is connected to the internet.
I am sure there are other issues if you are connected behind a proxy server, and I am not sure about your Gateway issue.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi.
I would like to create a unique icon for an Windows program via MFC. I have a few common questions.
First, what size(s) do the image file(s) have to be? How many images files are required? I remember reading a few weeks back that a program requires two images files for its icon.
Secondly, what format do you have to save the image file in order to import it directly to MFC's Resource Editor?
Thanks,
Kuphryn
|
|
|
|
|
In my app I have two icons. One of size 16x16 pixel and the other of size 32x32 pixel.
The best way to create icons is to use the software Microangelo with which you can generate icons and mouse cursors and probably more things...
Gero
|
|
|
|
|
Okay. Thanks.
If you made two sizes of one icon using Photoshop, how would you import the bitmaps into the resource editor? There is an option to import icons, but not bitmaps. Furthermore, what names do you need to name the icon such that it will replace the old MFC icons?
Kuphryn
|
|
|
|
|
If you do icons with Photoshop think about using Microangelo (http://www.impactsoft.com/). With this software you can import bitmaps and save them as icons or cursors.
I don't think that you can import bitmaps via Visual Studio directly and store them as icons.
Gero
|
|
|
|
|
i have a windows service exe i want it to be installed programatically how to do that?
i have created a setup wizerd which also contain that windows service exe.
i want windows service exe to be installed when setup wizered finish .
what setup i have to perform to do that?
Nish i have seen your example of N track setup file that will do that thing.plz help
if any body else could tell plzzzz
r00d0034@yahoo.com
|
|
|
|
|
Create a small exe and make your installer program run this exe at the end of the program setup. If you put this exe in the same directory as your service exe it'll be very easy to figure out the path to the service.
int WinMain(...)
{
...
CServiceHelper m_sh;
m_sh.SetServiceDisplayName("Your service description");
m_sh.SetServiceName("Your service name");
m_sh.SetServicePath(strPath);
m_sh.SetAutoStart(true);
m_sh.Create();
...
}
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
thanks for ur reply
plz one thing more.
i have created that setup wizered like u have created in
N track.i will created that exe too.
but i dont know how to make this installer program run this exe at the end of program setup?
plz tell.
again thanks a lot.
r00d0034@yahoo.com
|
|
|
|
|
To install a service, you generally use the InstalUtil.exe tool from the command line as:
InstalUtil svcname.exe
To install a service from a setup wizard (in VS.NET), you need to include a Custom Action in your wizard that executes on Commit when the wizard is run. (Take a look at the Custom Actions tab in a VS.NET setup project)
A Custom Action can execute an external .exe or a script. In the situation where you want to install a service, you could execute the InstallUtil in a script that is called as a custom action, or write a console application like the one below using the AssemblyInstaller class. The AssemblyInstaller loads an assembly, and runs all the installers in it.
To use the AssemblyInstaller, you need to include an Installer class in your service that registers your service.
There is not enough time for me to discuss all the details, but you may want to take a look at the AssemblyInstaller and the ServiceInstaller classes.
The following is the example given in the docs for the AssemblyInstaller class:
using System;
using System.Configuration.Install;
using System.Collections;
using System.Collections.Specialized;
class AssemblyInstaller_Example
{
static void Main()
{
IDictionary mySavedState = new Hashtable();
Console.WriteLine( "" );
try
{
// Set the commandline argument array for 'logfile'.
string[] commandLineOptions = new string[ 1 ] {"/LogFile=example.log"};
// Create an object of the 'AssemblyInstaller' class.
AssemblyInstaller myAssemblyInstaller = new
AssemblyInstaller( "MyAssembly.exe" , commandLineOptions );
myAssemblyInstaller.UseNewContext = true;
// Install the 'MyAssembly' assembly.
myAssemblyInstaller.Install( mySavedState );
// Commit the 'MyAssembly' assembly.
myAssemblyInstaller.Commit( mySavedState );
}
catch (ArgumentException)
{
}
catch (Exception e)
{
Console.WriteLine( e.Message );
}
}
}
To help you get started, an example Installer implementation will look something like this:
[RunInstallerAttribute(true)]
public class MyServiceInstaller : Installer
{
private ServiceInstaller _installer;
private ServiceProcessInstaller _processInstaller;
public MyServiceInstaller()
{
InstallServices();
}
public void InstallServices()
{
_processInstaller = new ServiceProcessInstaller();
_processInstaller.Password = null;
_processInstaller.Username = null;
_processInstaller.Account = ServiceAccount.LocalSystem;
Installers.Add(_processInstaller);
// Add each service to installer
_installer = new ServiceInstaller();
_installer.StartType = ServiceStartMode.Manual;
_installer.ServiceName = "YourServiceName";
_installer.DisplayName = "YourServiceDisplayName";
Installers.Add(_installer);
}
}
There may be typos above, but the intention is to point you to the right classes to use.
Gaul
Gaulles Technologies, Inc.
http://www.gaulles.com
|
|
|
|
|
if the software appears in add/remove program then i can go to registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
and look for uninstallString key.
but what is the rest of procedure to uninstall a software programatically?
i dont know how to get uninstallString key and how to run it in a program.can any body help me in this regard?
any example link where registry keys are used and run programatically. if u could provide i would be very thank full to you?
r00d0034@yahoo.com
|
|
|
|
|
Most installers will automatically create an uninstaller for you. If you want to give a short cut to that in your start menu folder, just locate the name of the uninstall executable. It might not even be an exe and might be in the msi uninstaller format.
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|