|
HI,
I wrote a following code to retrive RGBX bits from a bitmap, but does anyone know how to retive RGBTRIPLE bits using GETDIBits?
THanks
BITMAPINFO bi;
int height = Get_Bitmap_Info(bi);
if (!height)
return FALSE;
BYTE* p_bits = (BYTE*)new BYTE[bi.bmiHeader.biSizeImage];
HDC hdc = GetDC(NULL);
if (!GetDIBits(hdc, (HBITMAP)GetSafeHandle(), 0, height, p_bits, &bi, DIB_RGB_COLORS))
{
delete p_bits;
p_bits = NULL;
}
::ReleaseDC(NULL, hdc);
return (RGBX*)p_bits;
|
|
|
|
|
Dear All,
I am developing an application using MFC VC++ Version 6.0 for Windows 2000 OS in which I am running an inf file using ShellExecute api to install my driver.
Following is the small piece of code used to install the driver:
////////////////////////////////////////////////
void InstallSys()
{
char EZinf[1048];
strcpy(EZinf,"c:\\mydriver.inf"); //path of my driver
char EZlpParameters[uSize]= "setupapi,InstallHinfSection DefaultInstall 132 ";
strcat(EZlpParameters,EZinf);
ShellExecute(NULL, "open", "rundll32.exe",EZlpParameters, NULL, SW_HIDE);
}
////////////////////////////////////////////////
The code is working fine and installing the driver.
When I run the application, the application ,it calls Installsys() to install the driver and this displays a progress bar window titled "copying file" window and installs the driver.
I donot want this popup window to be displayed during my installation due to some reason. I have used SW_HIDE option in ShellExecute function but still the popup window is still being displayed.
Do I need to make some changes in the inf file?? Or I need to use the Inf SetUp File APIs (ie. SetupInstallFile or InstallHinfSection API) Please suggest some way to hide the dialog box and at same time installing the driver.
The installation part of mydirverinf is as:
/////////////////////////////////
;;
;; Default install sections
;;
[DefaultInstall]
OptionDesc = %FileSpyServiceDesc%
CopyFiles = FileSpy.DriverFiles, FileSpy.UserFiles
[SourceDisksNames]
1 = %Disk1%
[SourceDisksFiles]
filespy.exe = 1
EZOn.sys = 1
[DefaultInstall.Services]
AddService = %FileSpyServiceName%,,FileSpy.Service
////////////////////////////////
Please do let me know if you need further information in this regard.
Thanks a lot!
Regards,
Rohit Dhamija
|
|
|
|
|
Hello all,
i am sarching for old c++ compliers like torbu c++ 3 or 4.5 and also i am searching for similar one for linux can any body help me?
Thanks
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
try this link
Click Me[^]
and this link for borland turbo c
Click for borland[^]
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Thanks but do you know any others for windows
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
|
Thanks
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
I'am working on MFC,MDI App with Document/View Support
How cam I print on Paper Form with Dimmension 210x110mm
if in Print Setup Dialog for printer EPSON LX-400 I have only
next dimmensions:A4,A5,B5,Fanfold 8.5x12 in,Legal,Letter.
Printer is Tractor Feed
|
|
|
|
|
Is there any sample that demonstrates MDI application, without doc/view arch, with form view.
Thank you.
|
|
|
|
|
I don't understand, what you really expect. MDI is a technology based on doc/view architecture. Also CFormView is derived from CView => doc/view is necessary.
|
|
|
|
|
This is involved so I will try to describe my question as succinctly as possible.
I have an application that has a thread and a Callback function.
First there is a Reader thread which reads input from a serial port. It has two main functions.
1) Read data from the serial port if in normal operating mode.
2) Record key presses form the remote if in record mode.
Second there is a Callback function ConfigProc which is associated with a dialog that when active tells the Reader thread to go into record mode and once dismissed tells the Reader thread to go back to normal operation ( waiting for key presses from the remote control ). The Config dialog has buttons that when pressed put the reader thread in record mode and it stays that way until you press a button on your remote control.
My problem is this. I want to use a list control to store the commands I receive from the remote control instead of a config dialog with buttons on it. How do I now get the functionality of the Callback function ( ConfigProc ) without a dialog to associate it to.
My only idea is to have a learn button that when pressed starts a thread to do the functionality that was previously handled by the ConfigProc that was associated to the Config dialog. And then a stop button which will stop the thread.
What is the correct way to handle this situation?
Thanks, Steve
|
|
|
|
|
Yes, one solution is the button control.
It is a matter of design. Without a button control, the user has no control over the process. Again, it is a matter of design.
What is the specification as far as program features?
Kuphryn
|
|
|
|
|
I have no externally driven specification, as the project I am working on will eventually be released as open source. I can use whichever design I like. My intention is to design the user interface for training the remote control for use with my application to be as easy as possible and with as little mouse input as possible. So once the up, down, and enter functions on the remote have been trained the user would not need a mouse at all. So I am trying to get away from the config dialog that I mentioned previously so that user won't have to keep using a mouse to train each and every key on the remote. This project is a Home Theater Frontend that is being designed for use on a TV. So it is preferable to not require much mouse or keyboard input.
So, with this explaination I resubmit my question. Is the method I suggested a good/ correct one or is there a better method?
Steve
|
|
|
|
|
Hi,
I got a virus on my PC. I have figured out that there is a malicious *.dll (msconfd.dll in the system dir) on my system. Problem I can't delete it because it is attached to an instance of svchost.exe. I cant delete the *.dll while attached, and I cant delete the svchost.exe because another instance of it gets spawned immediately.
Please help. Thanks for any info in advance.
Pepe
|
|
|
|
|
|
thanks for your reply.
I did a scan with this tool, it makes a spectacular search through the file system, and found some html files in the temp internet files folder with some harmless javascript code in it which it called viruses but it didnt reveal anything about the above issue.
Just some more info about the beast:
It wrote itself to this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_Dlls
and as such attaches the all apps which link to the user32.dll. I could remove this entry manually but when the the dll detaches it writes itself back. This of course also happens on Windows exit, when the last UI app closes e.g. Regedit. It is also attached to svchost.exe as a result of which I am not able to delete the key "late enough".
I am stuck.
Pepe
|
|
|
|
|
It furthermore attaches to explorer.exe, cmd.exe, and all services too.
Seems to be the perfect virus.
|
|
|
|
|
First, go to www.sarc.com[^]. Under the heading "Virus Definitions" look for a link to "Free Online Virus and Security Check." Click on it, wait for the popup, then select the free virus scan. Once the scan is complete, it will identify the specific viruses it found by name. Write them down, along with all the path information about where they're located.
Return to the home page and search for the virus(es) by name. Once found, you should be directed to either a removal tool available for download, or instructions for manual removal. If it's a "popular" virus the removal tool will be listed on the main page. Follow the excellent step-by-step instructions they usually provide to clean your machine. If this solves the problem, say a thankful prayer (if you're so inclined) for Symantec for providing this extraordinarily useful website. And to really be properly thankful, buy yourself a copy of their antivirus product for Christmas and keep it up to date.
This site has saved many a customer's PC from the dreaded FDISK fate!
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
See if you can boot up in safe mode, then delete the DLL file.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi there
I have a question: how does a c++ compiler generate code?? does it convert the c++ code to c and then to assembly?? I am asking that because i need to write a number crunching program (it needs to be as fastest as possible), and i am thinking of initially writing it in C++ (i love C++'s OOP), then going to assembly. I am willing to sacrifice ease of programming in favor of speed, so should i write it in C or stay with C++??
Thanks
Thiago Guzella
|
|
|
|
|
Most compilers go from the language to a generic pcode format. Then the linker takes the pcode and generates machine code while doing some high level optimizations.
In general, C++ is just as fast as C but it can be easy to do silly stuff that slows C++ down. Also, with the current crop of optimizers, converting the C++/C code to asm usually is more of a waste than a benefit.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
The first C++ compiler (AT&T Cfront) used C as an intermediate step, but nearly all current C++ compilers create machine code directly. The only exception I know is Comeau C++
|
|
|
|
|
I see the code generation question have been aswered. Now for speed.
C is closer to asm than C++ and is therefore the best place to start if you think you may want to convert the code to asm. The conversion is not normaly needed as modern compilers are very good at optimizing. There is the possiblity that you could improve on the asm code produced by the compiler, but fist let it generate the code for you to examine what it has done. Also, make sure that it is being compiled as C code (not C++) or it might contain unneeded overhead.
Good luck!
INTP
|
|
|
|
|
Just wirte your assembly code as inline and make the function declaration as naked this will remove all c++ prolog and epilog to a function (like stack checking, parameter checking etc etc). if you do this then you dont have to worry what compier does.
|
|
|
|
|
If there's one thing I learned when I started diving into building my own compiler, it's that modern C and C++ compilers are smart. Very smart.
That said, they aren't perfect, and sometimes they'll focus optimizations on parts of your code that aren't as critical, or they'll refuse to do certain optimizations because it cannot be proven from the language definition that the optimization is safe. And, of course, they can't magically pick a better algorithm for you.
What this means in practical terms is that you shouldn't try to do premature optimizations. Write it in the language of your choice. Benchmark it. Profile it. You might just find that it's fast enough already. If not, you can find the bottlenecks and then break out the assembly.
- Mike, who has wasted entire too much time optimizing for code which wasn't a problem.
|
|
|
|