uda2004
Messages postés8Date d'inscriptionvendredi 20 mars 2009StatutMembreDernière intervention18 juin 2008
-
17 juin 2008 à 10:32
uda2004
Messages postés8Date d'inscriptionvendredi 20 mars 2009StatutMembreDernière intervention18 juin 2008
-
18 juin 2008 à 21:04
Bonjour à tous
J'ai un projet dll en visual c++, quand j'exécute tout va bien mais le fichier .dll ne se génére pas.
Est ce que vous avez une idée.
uda2004
Messages postés8Date d'inscriptionvendredi 20 mars 2009StatutMembreDernière intervention18 juin 2008 17 juin 2008 à 13:02
bonjour
merci pour la reponse
Quand j'utilise cette dll dans une application c#, une exception apparait
unable to load DLL (Exception HRESULT 0x8007007E)
est ce que vous avez une idee
Pistol_Pete
Messages postés1053Date d'inscriptionsamedi 2 octobre 2004StatutMembreDernière intervention 9 juillet 20137 17 juin 2008 à 17:54
C'est une question ou une affirmation?
Si c'est une affirmation, il faut verifier le chemin de ta dll, et surtout mettre une fonction vide dans ta dll pour etre sur que l'erreur ne provient pas de ta dll.
Pistol_Pete
Messages postés1053Date d'inscriptionsamedi 2 octobre 2004StatutMembreDernière intervention 9 juillet 20137 17 juin 2008 à 23:00
Montre donc nous le code de ta dll ainsi que la manière dont tu la déclares en C# avec la ligne ou l'exception se produit.
Avec ça on y verra plus clair.
double h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13,h14,h15,h16,h17,h18,h19,h20,h21,h22,h23,h24,h25,h26,h27,h28,h29,h30,h31,h32,h33,h34,h35,h36,h37,h38,h39,h40,h41,h42,h43,h44,h45,h46,h47,h48,h49,h50,h51,h52,h53,h54,h55,h56,h57,h58,h59,h60,h61,h62,h63,h64;
int r;
int g;
int b;
int i,j;
h1= 0;h2=0;h3=0;h4=0;h5=0;h6=0;h7=0;h8=0;h9=0;h10=0;h11=0;h12=0;h13=0;h14=0;h15=0;h16=0;h17=0;h18=0;h19=0;h20=0;h21=0;h22=0;h23=0;h24=0;h25=0;h26=0;h27=0;h28=0;h29=0;h30=0;h31=0;h32=0;h33=0;h34=0;h35=0;h36=0;h37=0;h38=0;h39=0;h40=0;h41=0;h42=0;h43=0;h44=0;h45=0;h46=0;h47=0;h48=0;h49=0;h50=0;h51=0;h52=0;h53=0;h54=0;h55=0;h56=0;h57=0;h58=0;h59=0;h60=0;h61=0;h62=0;h63=0;h64=0;
double hist[64];
int c1[3] = { 0, 0, 0 } ;
int c2[3]= {1, 0, 0};
int c3[3] = { 2, 0, 0};
int c4[3] = { 3, 0, 0} ;
int c5 [3]= { 1, 1, 0} ;
int c6 [3]= { 1, 2, 0} ;
int c7 [3]= { 1, 3, 0} ;
int c8 [3]= { 1, 1, 1 } ;
int c9 [3]= { 1, 1, 2 } ;
int c10 [3]= { 1, 1, 3 } ;
int c11 [3]= { 1, 2, 1 } ;
int c12 [3]= { 1, 2, 2 } ;
int c13 [3]= { 1, 2, 3 } ;
int c14 [3]= { 1, 3, 1 } ;
int c15 [3]= { 1, 3, 2 } ;
int c16 [3]= { 1, 3, 3 } ;
int c17 [3]= { 2, 1, 0 } ;
int c18 [3]= { 2, 2, 0 } ;
int c19 [3]= { 2, 3, 0 } ;
int c20 [3]= { 2, 1, 1 } ;
int c21 [3]= { 2, 1, 2 } ;
int c22 [3]= { 2, 1, 3 } ;
int c23 [3]= { 2, 2, 1 } ;
int c24 [3]= { 2, 2, 2 } ;
int c25 [3]= { 2, 2, 3 } ;
int c26 [3]= { 2, 3, 1 } ;
int c27 [3]= { 2, 3, 2 } ;
int c28 [3]= { 2, 3, 3 } ;
int c29 [3]= { 3, 1, 0 } ;
int c30 [3]= { 3, 1, 1 } ;
int c31 [3]= { 3, 1, 2 } ;
int c32 [3]= { 3, 1, 3 } ;
int c33 [3]= { 3, 2, 0 } ;
int c34 [3]= { 3, 2, 1 } ;
int c35 [3]= { 3, 2, 2 } ;
int c36 [3]= { 3, 2, 3} ;
int c37 [3]= { 3, 3, 0 } ;
int c38 [3]= { 3, 3, 1 } ;
int c39 [3]= { 3, 3, 2 } ;
int c40 [3]= { 3, 3, 3 } ;
int c41 [3]= { 0, 0, 1 };
int c42 [3]={ 0, 0, 2 };
int c43 [3]={ 0, 0, 3 };
int c44 [3]={ 0, 1, 1 };
int c45 [3]={ 0, 2, 1 };
int c46 [3]= { 0, 3, 1 };
int c47 [3]={ 0, 1, 2 };
int c48 [3]={ 0, 2, 2 };
int c49 [3]={ 0, 3, 2 };
int c50 [3]={ 0, 1, 3 };
int c51 [3]= { 0, 2, 3 };
int c52 [3]={ 0, 3, 3 };
int c53 [3]={ 0, 1, 0 };
int c54 [3]={ 0, 2, 0 };
int c55 [3]={ 0, 3, 0 };
int c56 [3]= { 1, 0, 1} ;
int c57 [3]= { 1, 0, 2 } ;
int c58 [3]= { 1, 0, 3 } ;
int c59 [3]= { 2, 0, 1 } ;
int c60 [3]= { 2, 0, 2 } ;
int c61 [3]= { 2, 0, 3 } ;
int c62 [3]= { 3, 0, 1 } ;
int c63 [3]= { 3, 0, 2 } ;
int c64 [3]= { 3, 0, 3 } ;
const char* p = path.data();
IplImage* photo=cvLoadImage(p,3);
int w=photo->width;
int h=photo->height;
uchar *data = (uchar*) photo->imageData;
CvMat *data1;
cvLaplace(data,data1,3);
CvMat *data2;
cvMatMul(data1, data1, data2);
for (i ; i < w; i++)
{
for ( j ; j < h; j++)
{
r = 0 ;
g = 0;
b = 0;
int pixelColorB =((uchar*)(photo->imageData + photo->widthStep*i))[j*3];
int pixelColorG =((uchar*)(photo->imageData + photo->widthStep*i))[j*3+1];
int pixelColorR =((uchar*)(photo->imageData + photo->widthStep*i))[j*3+2];
r = r + pixelColorR;
g = g + pixelColorG;
b = b + pixelColorB;
r = (r * 3) / 255;
g = (g * 3) / 255;
b = (b * 3) / 255;
double pond = cvmGet(data2,j,i);
if (c1[0]=r)
if (c1[1]=g)
if (c1[2]=b)
h1 = h1 + pond;
if (c2[0]=r)
if (c2[1]=g)
if (c2[2]=b)
h2 = h2 + pond;
if (c3[0]=r)
if (c3[1]=g)
if (c3[2]=b)
h3 = h3 + pond;
if (c4[0]=r)
if (c4[1]=g)
if (c4[2]=b)
h4 = h4 + pond;
if (c5[0]=r)
if (c5[1]=g)
if (c5[2]=b)
h5 = h5 + pond;
if (c6[0]=r)
if (c6[1]=g)
if (c6[2]=b)
h6 = h6 + pond;
if (c7[0]=r)
if (c7[1]=g)
if (c7[2]=b)
h7 = h7 + pond;
if (c8[0]=r)
if (c8[1]=g)
if (c8[2]=b)
h8 = h8 + pond;
if (c9[0]=r)
if (c9[1]=g)
if (c9[2]=b)
h9 = h9 + pond;
if (c10[0]=r)
if (c10[1]=g)
if (c10[2]=b)
h10 = h10 + pond;
if (c11[0]=r)
if (c11[1]=g)
if (c11[2]=b)
h11 = h11 + pond;
if (c12[0]=r)
if (c12[1]=g)
if (c12[2]=b)
h12 = h12 + pond;
if (c13[0]=r)
if (c13[1]=g)
if (c13[2]=b)
h13 = h13 + pond;
if (c14[0]=r)
if (c14[1]=g)
if (c14[2]=b)
h14 = h14 + pond;
if (c15[0]=r)
if (c15[1]=g)
if (c15[2]=b)
h15 = h15 + pond;
if (c16[0]=r)
if (c16[1]=g)
if (c16[2]=b)
h16 = h16 + pond;
if (c17[0]=r)
if (c17[1]=g)
if (c17[2]=b)
h17 = h17 + pond;
if (c18[0]=r)
if (c18[1]=g)
if (c18[2]=b)
h18 = h18 + pond;
if (c19[0]=r)
if (c19[1]=g)
if (c19[2]=b)
h19 = h19 + pond;
if (c20[0]=r)
if (c20[1]=g)
if (c20[2]=b)
h20 = h20 + pond;
if (c21[0]=r)
if (c21[1]=g)
if (c21[2]=b)
h21 = h21 + pond;
if (c22[0]=r)
if (c22[1]=g)
if (c22[2]=b)
h22 = h22 + pond;
if (c23[0]=r)
if (c23[1]=g)
if (c23[2]=b)
h23 = h23 + pond;
if (c24[0]=r)
if (c24[1]=g)
if (c24[2]=b)
h24 = h24 + pond;
if (c25[0]=r)
if (c25[1]=g)
if (c25[2]=b)
h25 = h25 + pond;
if (c26[0]=r)
if (c26[1]=g)
if (c26[2]=b)
h26 = h26 + pond;
if (c27[0]=r)
if (c27[1]=g)
if (c27[2]=b)
h27 = h27 + pond;
if (c28[0]=r)
if (c28[1]=g)
if (c28[2]=b)
h28 = h28 + pond;
if (c29[0]=r)
if (c29[1]=g)
if (c29[2]=b)
h29 = h29 + pond;
if (c30[0]=r)
if (c30[1]=g)
if (c30[2]=b)
h30 = h30 + pond;
if (c31[0]=r)
if (c31[1]=g)
if (c31[2]=b)
h31 = h31 + pond;
if (c32[0]=r)
if (c32[1]=g)
if (c32[2]=b)
h32 = h32 + pond;
if (c33[0]=r)
if (c33[1]=g)
if (c33[2]=b)
h33 = h33 + pond;
if (c34[0]=r)
if (c34[1]=g)
if (c34[2]=b)
h34 = h34 + pond;
if (c35[0]=r)
if (c35[1]=g)
if (c35[2]=b)
h35 = h35 + pond;
if (c36[0]=r)
if (c36[1]=g)
if (c36[2]=b)
h36 = h36 + pond;
if (c37[0]=r)
if (c37[1]=g)
if (c37[2]=b)
h37 = h37 + pond;
if (c38[0]=r)
if (c38[1]=g)
if (c38[2]=b)
h38 = h38 + pond;
if (c39[0]=r)
if (c39[1]=g)
if (c39[2]=b)
h39 = h39 + pond;
if (c40[0]=r)
if (c40[1]=g)
if (c40[2]=b)
h40 = h40 + pond;
if (c41[0]=r)
if (c41[1]=g)
if (c41[2]=b)
h41 = h41 + pond;
if (c42[0]=r)
if (c42[1]=g)
if (c42[2]=b)
h42 = h42 + pond;
if (c43[0]=r)
if (c43[1]=g)
if (c43[2]=b)
h43 = h43 + pond;
if (c44[0]=r)
if (c44[1]=g)
if (c44[2]=b)
h44 = h44 + pond;
if (c45[0]=r)
if (c45[1]=g)
if (c45[2]=b)
h45 = h45 + pond;
if (c46[0]=r)
if (c46[1]=g)
if (c46[2]=b)
h46 = h46 + pond;
if (c47[0]=r)
if (c47[1]=g)
if (c47[2]=b)
h47 = h47 + pond;
if (c48[0]=r)
if (c48[1]=g)
if (c48[2]=b)
h48 = h48 + pond;
if (c49[0]=r)
if (c49[1]=g)
if (c49[2]=b)
h49 = h49 + pond;
if (c50[0]=r)
if (c50[1]=g)
if (c50[2]=b)
h50 = h50 + pond;
if (c51[0]=r)
if (c51[1]=g)
if (c51[2]=b)
h51 = h51 + pond;
if (c52[0]=r)
if (c52[1]=g)
if (c52[2]=b)
h52 = h52 + pond;
if (c53[0]=r)
if (c53[1]=g)
if (c53[2]=b)
h53 = h53 + pond;
if (c54[0]=r)
if (c54[1]=g)
if (c54[2]=b)
h54 = h54 + pond;
if (c55[0]=r)
if (c55[1]=g)
if (c55[2]=b)
h55 = h55 + pond;
if (c56[0]=r)
if (c56[1]=g)
if (c56[2]=b)
h56 = h56 + pond;
if (c57[0]=r)
if (c57[1]=g)
if (c57[2]=b)
h57 = h57 + pond;
if (c58[0]=r)
if (c58[1]=g)
if (c58[2]=b)
h58 = h58 + pond;
if (c59[0]=r)
if (c59[1]=g)
if (c59[2]=b)
h59 = h59 + pond;
if (c60[0]=r)
if (c60[1]=g)
if (c60[2]=b)
h60 = h60 + pond;
if (c61[0]=r)
if (c61[1]=g)
if (c61[2]=b)
h61 = h61 + pond;
if (c62[0]=r)
if (c62[1]=g)
if (c62[2]=b)
h62 = h62 + pond;
if (c63[0]=r)
if (c63[1]=g)
if (c63[2]=b)
h63 = h63 + pond;
if (c64[0]=r)
if (c64[1]=g)
if (c64[2]=b)
h64 = h64 + pond;
using System.Runtime.InteropServices;
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Web;
using System.ComponentModel;
using System.Drawing;
using MySql.Data.MySqlClient;
MySql.Data.MySqlClient.MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection();
MySqlCommand MyCommand1 = new MySqlCommand();
MySqlCommand MyCommand2 = new MySqlCommand();
Pistol_Pete
Messages postés1053Date d'inscriptionsamedi 2 octobre 2004StatutMembreDernière intervention 9 juillet 20137 17 juin 2008 à 23:53
Bon ta fonction dans ta dll retourne un pointeur sur un double
extern "C"
__declspec(dllexport) double* calculHist(string path)
Est tu sur que Intptr est un pointeur pour un double?
Enfin pour ta dll, je n'ai jamais vu un code aussi moche... Enfin ce n'ai que mon avis mais je suis sur que tu peux optimiser grandement cette fonction.
Tu veux faire quoi exactement, calculer l'histogramme de l'image?
Et fait attention, tous tes if sont des affectations:
if (c60[0]=r)
est equivalent à c60[0]=r;
Que ce passe t'il si tu commentes tout le code de cette fonction dans la dll, y a t'il toujours cette exception?