|
} as far is gif is concern i have used the CPictureEx class , there is good article on code project , few articles on CxImage also
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
blackeye2004 wrote: how to display a gif by cximage
CxImage is very Heavy Class. it wil add around 200 to 400 kb to your code depending on Option selected. Better use CEnBitmap by Mr Dan.g. it's is nice CBitmap derived class for Popular Image Format.
here is link for that: -
http://www.codeproject.com/bitmap/extendedbitmap2.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have studied the article "Serical Communication in Windows".
It talk about the event driven in Com port, but the reading process of demo program is driven by button.
I would like to know how to do event driven in this demo program.
For example: Automatically detect the com port input data and display the data in the Edit box.
Please help!
|
|
|
|
|
Hi,
Check this[^]
If u r planned to implement serial communication in GUI based application then do read,write... operations in separate thread.
Bye
Cool Ju
Dream Ur Destiny
|
|
|
|
|
I would like to know how to implement it in MFC?
Please help!
|
|
|
|
|
you should go to artical and search for authors: konchat, Ramon de klein, Ashish Dhar. I think you will find many choices for you. I got problem like you a month ago. Cheers.
VC++2003 is not easy to learn than VB or builder C++
MilkyWay
|
|
|
|
|
I tried to post on CodeProject today but "Too many users are trying to ... the server" so i posted the same problem on CodeGuru.com also. My problem is that in linux as super block of ext2 file system is placed in 2nd block of floppy which starts at 1024 and also name of file sytem is written on 57th and 58th bytes of super block so I have written following code to check the file system on floppy but this code is not giving me any output. Can anyone tell me what is problem.
HANDLE fp;<br />
short int data = 0;<br />
DWORD count;<br />
fp = CreateFile ("\\\\.\\a:",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_ALWAYS,0,NULL);<br />
SetFilePointer(fp,1024+56,NULL,FILE_BEGIN);<br />
ReadFile(fp,&data,2, &count, NULL);
cout <<data;
We Believe in Excellence
|
|
|
|
|
Good morning.
The argument to SetFilePointer() HAS to be an even multiple of the sector size. In your case (a diskette), the sector size is 512.
In fact, ALL operations on a disc device is done on one (or more) complete sector(s) at the time. This goes for seek, read and write.
So:
First, set the file pointer to an even mutiple of 512, in this case it will be 1024.
Then, read a complete (or more) sector(s). A sector is the smallest bit of information a disk device can handle.
Try this:
<br />
HANDLE fp;<br />
short int data = 0;<br />
DWORD count;<br />
unsigned char buffer[512];<br />
fp = CreateFile ("\\\\.\\a:",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_ALWAYS,0,NULL);<br />
SetFilePointer(fp,1024,NULL,FILE_BEGIN);<br />
ReadFile(fp,buffer,512, &count, NULL);
data = *(buffer + 56);<br />
cout <<data; <br />
Kakan
-- modified at 1:57 Thursday 24th November, 2005
|
|
|
|
|
Thanks Mr. Kakan
for helping me every time. It solved my problem.
We Believe in Excellence
|
|
|
|
|
Hello Aqueel.
You'r welcome.
I glad to be able to help. Don't hesitate to ask again, if you get into trouble.
Kind regards
Kakan.
|
|
|
|
|
1. How can I display an image, like an image editor, in full screen mode?
2. What is the fastest method displaying an image (both in window or in full screen)? Some programs work much faster than others; scrolling an image takes much longer with some programs than with others.
Thanks
|
|
|
|
|
Vancouver wrote: . How can I display an image, like an image editor, in full screen mode?
is CDC::StretchBlt is of any help
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
is CDC::StretchBlt is of any help
StretchBlt is a different issue. In the meantime I found that both SetWindowPos and MoveWindow work with the co-ordinates (0,0) as well (I had thought that would be rejected).
However, this is probably no help for my original problem: performance.
|
|
|
|
|
is there anybody that know how to connect, when i enter matrik no at client side then at the admin side the statistic graph will increase everytime i enter the number. only admin can see this statistic.. please anybody know?
|
|
|
|
|
I'm trying to sort an array of race objects by its raceid and I can't figure out what's wrong I don't seem to get any weird errors other than the most obvious that it doesn't work. Could someone point out what's wrong with my code?
Thanks!
void sortRaces(race theRaces[], int number_used)
{
int index_of_next_smallest;
for (int index = 0; index < number_used - 1; index++)
{
index_of_next_smallest = index_of_smallest(theRaces, index, number_used);
swap_races(theRaces[index], theRaces[index_of_next_smallest]);
}
system("cls");
skip(2);
pause("The races have been sorted");
}//end sortRaces
void swap_races(race &race1, race &race2)
{
race temp;
temp = race1;
race1 = race2;
race2 = temp;
}
int index_of_smallest(race theRaces[], int start_index, int number_used)
{
int min = theRaces[start_index].getraceID();
int index_of_min = start_index;
for (int index = start_index + 1; index < number_used; index++)
{
min = theRaces[index].getraceID();
index_of_min = index;
}
return index_of_min;
}
|
|
|
|
|
The second best way to do this is a bubble sort, which basically is a nested loop that swaps elements with the one next to them as needed, in the inner loop. The outer loop means it's called often enough for the item at the bottom to get a chance to 'bubble' to the top if need be.
The best way is to store your objects in a vector and write a function object to pass to the sort function.
Here[^] is my article on how to do that.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
When I refresh a Edit Control’s text every 1.5second, the Edit Control flashes occasionally. Anybody can tell me why and how to avoid it.
In same application, my other Edit Control do the same things, but won’t flash.
|
|
|
|
|
Hi all,
This is not a problem I'm seeing with my own applications, but this can definitely be labeled a programming question...
Right now I have two applications running on my machine that are consuming over 2000 handles each: Outlook 2003, and RSS Bandit.
SysInternal's Process Explorer shows that both of these have hundreds of handles to HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap being held.
Searching Google for "leak" and "internet settings\zonemap" comes up with a few hits, one of them from some guy claiming that a simple C app that brings up a dialog box with IE and then destroys it is leaking two handles to that same key. That post is dated February of this year, and it had no reply.
I'm running XP Pro with all the latest updates.
Anyone else? Thoughts, comments?
|
|
|
|
|
I'm trying to search an input file for all occurences of a user specified string and return how many times the word was found and read that into an output file. For some reason the the value of the string changes to every word in the text file at runtime. What am I doing wrong?
#include <iostream><br />
#include <string><br />
#include <ciso646><br />
#include <fstream><br />
using namespace std;<br />
<br />
int main(void)<br />
{<br />
<br />
<br />
string filename;<br />
cout << "Please enter the name of the file: " ;<br />
cin >> filename;<br />
string search;<br />
cout << "Please enter the word to search for";<br />
cin >> search;<br />
<br />
ifstream fin(filename.c_str());<br />
while (fin.fail())<br />
{<br />
cout << "invalid file name"<< endl;<br />
cout << endl << "Please enter the name of the file: ";<br />
cin >> filename;<br />
<br />
fin.clear();<br />
fin.open( filename.c_str() );<br />
<br />
}<br />
<br />
int count=0;<br />
<br />
while (fin >> (search))<br />
{<br />
<br />
count++;<br />
<br />
}<br />
<br />
ofstream fout("output.txt");<br />
fout << "The number of times "<< search <<" was found is "<< count << endl;<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
system ("pause");<br />
return 0;<br />
}
BINARY
|
|
|
|
|
Binary,
Your problem exists here:
while (fin >> (search))
{
count++;
}
You are reading a "word" from your file and storing it in the string that you declared to hold your search term. Instead, reuse the filename variable or declare a new one.
while (fin >> (filename))
{
count++;
}
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
-- modified at 16:04 Wednesday 23rd November, 2005
|
|
|
|
|
Hi!.
I'm trying to build an existing VC++ 6.0 activex project for Pocket PC with Visual Studio 2005.
With the "Configuration manager" I have added the plataform "Pocket PC 2003 (ARMV4)", that's what I want for now.
But the compiler throw the following error:
"Error 1 fatal error C1189: #error : Must define a target architecture. c:\Archivos de programa\Microsoft Visual Studio 8\SmartDevices\SDK\PocketPC2003\include\winnt.h 648 "
So, it looks that in some place I should define the target architecture, (ie: _WIN32, but for WINCE), but where?, and what is the #define???
Thank you.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
Hi,
Where to put my Registration or Login Screen Dialog in a Document/View SDI (MFC) application ? I tried to the InitInstance but i get Assert errors.
I suppose there are two ways to show this dialog, 1)Before the application starts 2) Just after the Application start
Regards,
George
sdancer
|
|
|
|
|
I usually do this, after the application has started. If you don't want to show the main dialog, hide it after InitInstancd and before showing the registration one ...
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Hi,
In Initinstance
m_pMainWnd->LaunchLoginScreen();
In mainfrm.cpp
LaunchLoginScreen()
{
LoginDlg = new LoginDlg();
LoginDlg->DoModal();
delete LoginDlg;
LoginDlg=NULL;
}
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
Hi,
Is there any way in MFC to have global variables ? I need this, for example to have access to a database connection string, from anywhere in the program not only in the Document/View but in the Dialogs too.
Regards,
sdancer
|
|
|
|