Click here to Skip to main content
15,913,685 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: dll problem. Pin
Mark Salsbery23-Apr-07 7:34
Mark Salsbery23-Apr-07 7:34 
GeneralRe: dll problem. Pin
Hamid_RT23-Apr-07 7:39
Hamid_RT23-Apr-07 7:39 
GeneralRe: dll problem. Pin
Mark Salsbery23-Apr-07 7:43
Mark Salsbery23-Apr-07 7:43 
GeneralRe: dll problem. Pin
Hamid_RT23-Apr-07 7:57
Hamid_RT23-Apr-07 7:57 
GeneralRe: dll problem. Pin
David Crow23-Apr-07 8:06
David Crow23-Apr-07 8:06 
QuestionCrash analysis Pin
Shiva Prasad23-Apr-07 7:03
Shiva Prasad23-Apr-07 7:03 
AnswerRe: Crash analysis Pin
Cedric Moonen23-Apr-07 7:31
Cedric Moonen23-Apr-07 7:31 
QuestionHow to get .bmp greyscale Image Header info in C Pin
Hazardcoder23-Apr-07 6:32
Hazardcoder23-Apr-07 6:32 
Hi all

Fistly , I know this is a Visual C++ forum , but i really need help on my problem in C. So kindly bear with me Smile | :) !!
Here is the code I wrote to get the .bmp greyscale Image Header info in C
<br />
#include <stdio.h>  /* header file  */<br />
#include <stdlib.h><br />
#include <math.h><br />
int main()<br />
{<br />
 struct Image{<br />
        int rows;<br />
        int column;<br />
        unsigned char *data;<br />
 } sImage;<br />
 FILE *fpr;   /* file pointer */<br />
 FILE *fpw;<br />
 int i,j;<br />
 char imagein[20];<br />
 char imageout[20];<br />
 //sImage originalImage;<br />
 unsigned char *ptrC;<br />
 unsigned char dummy;<br />
 long filesize;<br />
 int r, c;<br />
 dummy = '0';<br />
 ptrC = &dummy;<br />
 <br />
 printf("Enter input image : ");<br />
 gets(imagein);<br />
 printf("Enter output image : ");<br />
 gets(imageout);<br />
 <br />
 /* open file for output */<br />
 if ((fpr = fopen(imagein, "rb"))==NULL){<br />
  printf("Cannot open source file \n");<br />
  exit(1);<br />
 }<br />
 if ((fpw = fopen(imageout, "w"))== NULL){<br />
          printf("Cannot open target file.");<br />
          fclose(fpr);<br />
          exit(1);<br />
 }<br />
 <br />
 fseek(fpr, 0, SEEK_SET);<br />
 sImage.rows = getImageInfo(fpr, 22, 4);<br />
 printf("Number of rows : %d",&sImage.rows);<br />
 sImage.column = getImageInfo(fpr, 18, 4);<br />
 printf("Number of columns : %d",&sImage.column);<br />
 filesize = getImageinfo(fpr, 2, 4);<br />
 printf("Filesize : %ld",&filesize);<br />
 fseek(fpw, 0, SEEK_SET);<br />
 r = sImage.rows;<br />
 c = sImage.column;<br />
 for (i=0; i<r; i++){<br />
     for(j=0; j<c; j++){<br />
              fread (ptrC, sizeof(char), 1, fpr);<br />
              fwrite(ptrC, sizeof(char), 1, fpw);<br />
     }<br />
 }<br />
 fclose(fpr);<br />
 fclose(fpw);<br />
 getch();<br />
 return 0;<br />
}<br />
<br />
long getImageInfo(FILE* inputfile, long offset, int numberofchars)<br />
{<br />
  unsigned char	*ptrC;<br />
  long	value = 0L;<br />
  unsigned char	dummy;<br />
  int i;<br />
<br />
  dummy = '0';<br />
  ptrC = &dummy;<br />
<br />
  fseek(inputFile, offset, SEEK_SET);<br />
<br />
  for(i=1; i<=numberOfChars; i++)<br />
  {<br />
    fread(ptrC, sizeof(char), 1, inputFile);<br />
    /* calculate value based on adding bytes */<br />
    value = (long)(value + (*ptrC)*(pow(256, (i-1))));<br />
  }<br />
  return(value);<br />
}<br />
<br />


And the error I get is :-
"Conflicting type of 'getImageInfo'. "


Could anyone please tell me , where i m possibly going wrong ....

Thanks a lot !!
Questionget address of focus window Pin
mahdiehIR23-Apr-07 6:11
mahdiehIR23-Apr-07 6:11 
QuestionRe: get address of focus window Pin
Mark Salsbery23-Apr-07 7:18
Mark Salsbery23-Apr-07 7:18 
Questionget active directory Pin
mahdiehIR23-Apr-07 5:47
mahdiehIR23-Apr-07 5:47 
AnswerRe: get active directory Pin
Mark Salsbery23-Apr-07 5:54
Mark Salsbery23-Apr-07 5:54 
GeneralRe: get active directory Pin
toxcct23-Apr-07 5:56
toxcct23-Apr-07 5:56 
QuestionHow to Backup and restore MS Access Database Using Vc++ Pin
gsheladia23-Apr-07 3:58
gsheladia23-Apr-07 3:58 
QuestionRe: How to Backup and restore MS Access Database Using Vc++ Pin
David Crow23-Apr-07 4:35
David Crow23-Apr-07 4:35 
AnswerRe: How to Backup and restore MS Access Database Using Vc++ Pin
gsheladia23-Apr-07 23:37
gsheladia23-Apr-07 23:37 
QuestionRe: How to Backup and restore MS Access Database Using Vc++ Pin
David Crow24-Apr-07 2:36
David Crow24-Apr-07 2:36 
QuestionSHFileOperation function Pin
Syamlal S Nair23-Apr-07 2:27
Syamlal S Nair23-Apr-07 2:27 
AnswerRe: SHFileOperation function Pin
David Crow23-Apr-07 4:37
David Crow23-Apr-07 4:37 
GeneralRe: SHFileOperation function Pin
Syamlal S Nair23-Apr-07 23:31
Syamlal S Nair23-Apr-07 23:31 
QuestionRe: SHFileOperation function Pin
David Crow24-Apr-07 2:39
David Crow24-Apr-07 2:39 
QuestionOutput in VC++ Debug window Pin
ragavan23-Apr-07 2:19
ragavan23-Apr-07 2:19 
AnswerRe: Output in VC++ Debug window Pin
Don Box23-Apr-07 2:32
Don Box23-Apr-07 2:32 
AnswerRe: Output in VC++ Debug window Pin
Michael Dunn23-Apr-07 15:29
sitebuilderMichael Dunn23-Apr-07 15:29 
Questionoperator new and classes in dll (NET) Pin
Russell'23-Apr-07 2:07
Russell'23-Apr-07 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.