|
Have you even considered browsing CodeProject for this?
More specifically this part[^]?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Have you looked at the Win32_USBxxx WMI classes?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I need source to resize image bmp. I wish everybody help me. thanks very much
nothing
|
|
|
|
|
You may create a compatible bitmap with the desidered size and then bit-blit the original one into it.
If you need to resample the image (i.e. to resize without too quality loss) then have a look at my DLL [^] (you may also use GDI+ ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You can use StretchBlt if you dont need to save it.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
If the image is available in a file, you can resize it when you load it using LoadImage by giving the required dimension in the cxDesired and cyDesired parameters.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Sure see Scaling an Image (Windows)[^] (dont forget vote to me ).
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
this is a part of a code to solve n*n linear equation iam testing this part with trial equation all i want it to do is to add variables in V and add coff. in Num iam facing a problem could U help me please
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<ctype.h>
void main()
{
char* p;
char* eq[81]={"-36x+42yz+-35a","3x+4yz","yz+3x"};
char* varname[20]={"yz","x","a"};
char* v[20];
char* num[20];
char coff[20];
int n=0,i=0,j=0,s=0;
for(i;i<2;i++)
{
for(int k=0;k<strlen(eq[i][81]);k++)
{
if(isalpha(eq[i][81]!=0))
{
v[j][20]=eq[i][81];
j++;
}
else if(isdigit(eq[i]!=0))
{
num[n][20]=eq[i][81];
n++;
}
else if(s[i]=='-')
{
num[n]=-1*s[i+1};
n++;
i++;
}
}
}
& those are the errors
C:\Documents and Settings\karim\Desktop\cC\to fill coff\2.cpp(18) : error C2664: 'strlen' : cannot convert parameter 1 from 'char' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\Documents and Settings\karim\Desktop\cC\to fill coff\2.cpp(31) : error C2109: subscript requires array or pointer type
C:\Documents and Settings\karim\Desktop\cC\to fill coff\2.cpp(33) : error C2143: syntax error : missing ']' before '}'
C:\Documents and Settings\karim\Desktop\cC\to fill coff\2.cpp(33) : error C2109: subscript requires array or pointer type
C:\Documents and Settings\karim\Desktop\cC\to fill coff\2.cpp(33) : error C244
|
|
|
|
|
Please use surround your code snippet with <pre> tags (use the code block button).
kimbz_007 wrote: char* eq[81]={"-36x+42yz+-35a","3x+4yz","yz+3x"};
why not
const char* eq[]={"-36x+42yz+-35a","3x+4yz","yz+3x"}; ?
kimbz_007 wrote: for(int k=0;k<strlen(eq[i][81]);k++)
the above line is wrong, use
for(int k=0;k < strlen(eq[i]);k++)
the same applies to
kimbz_007 wrote: if(isalpha(eq[i][81]!=0))
{
v[j][20]=eq[i][81];
j++;
}
change as follows
if(isalpha(eq[i][k]!=0))
{
v[j]=eq[i][k];
j++;
}
and so on....
You should reconsider your approach to arrays...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
All I can suggest is that you try to learn a little more about arrays and strings in C - there's so much wrong here htat I don't know where to start....but I'll try.
kimbz_007 wrote: char* eq[81]={"-36x+42yz+-35a","3x+4yz","yz+3x"};
This is an array of 81 string pointers. The first three (eq[0], eq[1] and eq[2]) have values.
kimbz_007 wrote: char* varname[20]={"yz","x","a"};
This is an array of 20 string pointers. The first three (varname[0], varname[1] and varname[2]) have values.
kimbz_007 wrote: strlen(eq[i][81])
This is attempting to find the string length of the 81st character of the 'i'th string. This has no meaning, as detected (via the compiler) by the type system, causing the first error. You probably mean strlen(eq[i])
kimbz_007 wrote: if(isalpha(eq[i][81]!=0))
This'll cause you grief - firstly, eq[i][81] is only defined if the 'i'th string has 82 characters or more - none of yours do. Also, you're determining if eq[i][81]!=0 is an alphabetic character. Again, even if the string was big enough, that is meaningless - I guess you've misplaced a closing bracket.
kimbz_007 wrote: else if(s[i]=='-')
kimbz_007 wrote: num[n]=-1*s[i+1};
You declared 's' as an integer variable, not an integer array. Those expressions are therefore meaningless and are also syntactically incorrect.
As I said - try to learn a bit more about the basics of the language (strings, arrays, pointers). Or use a different language which can help abstract those details out of the way.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
thank you for Ur advices really i am in problem only days for assignement i will try to get this over thanks
|
|
|
|
|
Good Luck!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hi,
I am trying to run an exe in mfc,which needs a command prompt with some conditions to be given(it will not work normally). this is useful for converting dicom image to bitmap image..so can any one suggest the method.
|
|
|
|
|
|
Hi all.
i have error as:
i using invalidate() and UpdateWindow() to repaint windown.
but when i lock PC (window key + L) and after that i log on in to PC.
invalidate() and UpdateWindow() called but ondraw(CDC *pdc) funtion not run.
please help me about this error.
|
|
|
|
|
|
Well, I suppose you have to write some code...
What is your doubt about?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Well you haven't to hard-code the resize routine of every control. Code maybe smart (you know iterations,...).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
This CodeProject article[^] about automatically resizing controls in a dialog when the dialog is resized might be of use to you....
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
What's with this habit of deleting your messages ? Please stop doing that: other people might find useful information in your problem...
|
|
|
|
|
Hi all,
Are there any source code or algorithm about drawing spider chart or star chart in MFC dialog (VC6)?
thanks
あんかた
|
|
|
|
|
Hii
In my program I'm reading the clusters in the volume using the appropriate physical offsets to the disk.
drive_handle=Createfile(L"\\\\.\\PhysicalDrive0",......);
for( i=0;total_noof_clusters;i++)
{
phys_offset_source= conversion(i);
phys_offset_dest= conversion(i);
DWORD dwPtr1=SetFilePointer(drive_handle,phys_offset_source,NULL,0);
if (dwPtr1 == INVALID_SET_FILE_POINTER)
{
printf("\nSetFilePointer Failed to read from source,:%d\n",GetLastError());
return 0;
}
if(!ReadFile(drive_handle,
bBuffer1,
cluster_size,
&dwRetBytes1,
0))
{
printf("\nUnable to Read the Disk Error: %d\n",GetLastError());
return o;
}
DWORD dwPtr2=SetFilePointer(drive_handle,phys_offset_dest,NULL,0);
if (dwPtr2 == INVALID_SET_FILE_POINTER)
{
printf("\nSetFilePointer Failed to write position%d\n",GetLastError());
return 0;
}
if(!WriteFile(drive_handle,
bBuffer1,
cluster_size,
&dwRetBytes1,
0))
{
printf("\nUnable to write he Drive Error: %d\n",GetLastError());
return o;
}
}
The above code not giving no (compilation and link)error messages,
But does not give the result.
How do we know the program reading correctly?
It returns the correct no of bytes read after one read operation .
When I wrote theses data into destination , nothing wrote.
What may be the problem??
Where is the mistake in the code ?
Any idea?
-----------
Thanking you
Krish
krishnampkkm is online now Report Post Edit/Delete Message
|
|
|
|
|
krish_kumar wrote: In my program I'm reading the clusters in the volume using the appropriate physical offsets to the disk.
I could not understand how could achieve this using SetFilePointer , that uses an offset relative to the start of the file.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hiiii
As per MSDN the condition is "file handle must be created with the GENERIC_READ or GENERIC_WRITE". Here I opened a Hard disk handle using NTFs in windows xp.
------------
thanking you
------------
|
|
|
|