|
Thanks for the reply there!
I see what you mean about C++ not just being a fancy C...
Thanks for the pointers there as well - I will have another crack at it today.
As for the dll stuff... i am trying to enable read / write access to the parallel port. I had a console application working (with DEV (Bloodshed) C++ editor) which required inout32.dll to be placed in the system32 folder, and then with the use of a couple of special function calls the enitre process of parallel port access was very straight forward.
The problem was that when i ported that application across to VC++ it stopeed working. i more or less copied and pasted my entire code into the 'action' of a button press. The programme compiled and ran, but clicking the button (which should have simply sent 0x255 to the parallel port) crashed the programme.
Once again, thanks for the help so far - very much appreciated!
Mark
|
|
|
|
|
First, dlls will also be loaded from the working directory. Be aware, however, that in Visual Studio projects are typically organized as a directory and that while <projname>\debug and < progname >\release are the two directories containing the debug and release builds, respectively, the working directory is set to just <projname> . So you should just be able to put that dll into the project directory.
As for the code you pasted, how are you loading the dll? Run time via a lib or run time via LoadLibrary / GetProcAddress? Are you getting valid function pointers? What exactly is crashing? What line? Do you get errors beforehand?
earl
|
|
|
|
|
hi
i made a dialob box now i wnat to put a wallpaper on it from drive d
but i also want that when i put wallpaper then the buttons or other controls which i put on dialog box remain same and they appear over the wallpaper but
only with there value on it as in widows xp
thanks
Ashish Dogra
MCA
Noida
|
|
|
|
|
for load image use CImage and use Load for darw picture you can use WM_PAINT or WM_WM_ERASEBKGND dc.BitBlt(...);
<br />
CImage m_Image;<br />
m_Image.Load(filename);<br />
in Onpaint use <br />
Bitblt(dc.m_hdc,0,0,800,600,m_Image.GetDC(),0,0,SRCCOPY);<br />
i dont test this code
whitesky
|
|
|
|
|
thanks for your reply
i put this code in oninitdialog()
CImage m_Image;
m_Image.Load(filename)//can i put filename as path of that wallpaper or wallpapers name);
and put this in onpaint
Bitblt(dc.m_hdc,0,0,800,600,m_Image.GetDC(),0,0,SRCCOPY);
but this gives errors as Bitblt undeclared identifier
and CImage as undeclared identifier
Ashish Dogra
MCA
Noida
|
|
|
|
|
BitBlt and include AtlImage.h
whitesky
|
|
|
|
|
plz tell me how to handle this problem
thanks but by including #include "AtlImage.h"
there is an error that is
fatal error C1083: Cannot open include file: 'AtlImage.h': No such file or directory
and plz tell me on filename i use thats path or simply wallpaper name
Ashish Dogra
MCA
Noida
-- modified at 8:44 Friday 7th July, 2006
|
|
|
|
|
if you get this error maybe you dont have this file in your computer and use AtlImage with <> but if you using <> if your file is Bmp you can use LoadImage but your file is jpg you can use Graphics::DrawImage and Image::FromFile or you can use OleLoadPicture
whitesky
|
|
|
|
|
ashish dogra wrote: but this gives errors as Bitblt undeclared identifier
and CImage as undeclared identifier
This should come as no surprise since Bitblt() is different than BitBlt() . m_Image is local to the OnInitDialog() method so there is no way that it can be used on the OnPaint() method.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello Mr DavidCrow,
I think his problem is AtlImage.h
whitesky
|
|
|
|
|
yar dont argue with each other
and if you can solve my problem then do it plz
thanks
Ashish Dogra
MCA
Noida
|
|
|
|
|
I said you in previous message and you can choose one way from they
whitesky
|
|
|
|
|
Hello, anyone knows what this message means? warning C4996: 'fopen' was declared deprecated
|
|
|
|
|
deprecated = something that is planned to be removed in the future
usually when you see that message, the compiler suggests am alternative call. (fopen_s is the replacement for fopen, i think)
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
is there a way to count words in a string the same as .GetLenght(hello) = 5 i need a way to count the words in a string = 11.
|
|
|
|
|
Words in a string means? Distinct number of words, separated by spaces? You can find out the number of spaces in your string and then add one to this count. It will be the number of words.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
loop through every character in the string and count the characters which separate words (white-space, punctuation, etc) . actually, it's probably easier if you just count the number of times a letter (or number?) comes after whitespace or punctuation.
Cleek | Image Toolkits | Thumbnail maker
-- modified at 7:49 Friday 7th July, 2006
|
|
|
|
|
|
Typically this problem is used in data structures courses. There are several different algorithms for it, but here is a fairly easy one:
- Split the string based on delimiters (spaces, punctuation) and place results in an array (vector or list works fine).
- Remove any null strings from the array.
- Return the count of the array.
There are more sophisticated algorithms for counting words that involve grammar checking ... but this algorithm is sufficiently fast for most cases.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
i would but im new at this and have been reading about array's and im still lost as to how to make one add to it and get date back from it.
|
|
|
|
|
locoone wrote: i would but im new at this and have been reading about array's and im still lost as to how to make one add to it and get date back from it
An array can be as simple as declaring char buffer[1000] . I was using the term rather generically in that post. You would most likely want to use std::list or std::vector for this problem.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
i have no clue about them either as i said im new at this and msdn isnt much help.
|
|
|
|
|
locoone wrote: i have no clue about them either as i said im new at this and msdn isnt much help.
Bah! Shame on you! MSDN is perhaps one of the best documentation tools available ...
That said, if you are just beginning, you should stop trying to write code and go to Barnes and Noble to pick up a few intro to C/C++ books. Otherwise, I can offer suggestions on what to do all day and you won't understand a single word of it.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
well please do me a favor and find a page in msdn that show how to make and add data to an array i think to get it back its just name[1]; aint it?
|
|
|
|
|
Declaring an array is nothing more than this:
type name[size];
For example, an array of 100 characters called 'buffer' would be declared as follows:
char buffer[100];
You access individual elements in the array by the 0-based index, so accessing the first character is done by:
buffer[0] = 'a';
cout << buffer[0] << endl;
To access the last character, you would write:
buffer[99] = 'a';
cout << buffer[99] << endl;
And every other character can be accessed with indicies between 0 and 99.
Those are C-style arrays. C++ has classes called vector , list , stack , queue , deque , map , etc ... which are all different forms of "arrays" (here meaning "container of elements"). If you look up list or vector in MSDN, it will give you a list of methods as well as an example or two using them. If you want to know what they should be used for, get a book that explains them in detail (MSDN is a reference guide -- not a tutorial or beginner's manual).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|