お世話になっております。
現在、VC++6.0にてアプリを開発中です。
そこで、下記エラーが発生し、処理がうまく行きません。
エラーの内容と、対策をお教え下さい。
[エラー内容]
Debug Error!
Program:xxxxxxxxx.exe
Module:
File:i386\chkesp.c
Line:42
The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
(Press Retry to debug the application)
エラー発生の場所は、GetProcAddressで、DLLの関数のアドレスを取得し、その関数をコールした結果で起こっています。
DLL内部にログ出力を入れた結果、DLLの関数自体は正常終了しています。
DLLの関数を取得している部分は下記の通りです。
typedef int (APIENTRY *LPGetRouteList)(WORD wdIn1, WORD wdIn2, WORD wdin3);
・
・
・
LPGetRouteList lpGetRouteList;
・
・
・
lpGetRouteList = (LPGetRouteList)GetProcAddress(hHandle,"GetRouteList);
関数を使用している部分は、下記の通りです。
int iRet = 0;
・
・
・
iRet = lpGetRouteList(wdA, wdB, wdC); <- ここでエラーが発生
DLLの関数は以下の通りです。
extern WORD APIENTRY GetRouteList(WORD wdIn1, WORD wdIn2, WORD wdIn3)
{
WORD wdRet = 0;
・
・
・
return(wdRet);
}
以上、長文で見づらいと思われますが、なにとぞ宜しくお願いします。
No.1ベストアンサー
- 回答日時:
The value of ESP was not properly saved across a function call.
This is usually a result of calling a function declared with
one calling convention with a function pointer declared with
a different calling convention.
ESPの値が関数呼出を通じて正しく保存されなかった.
これは通常ある呼出規約で宣言された関数を
それとは異なる呼出規約の関数ポインタで呼び出した結果である.
したがって、
DLL側で本当にAPIENTRYがついているかをチェックし、
あとは関数の戻り値がintとWORDで不一致なのをWORDに統一して試してください.
参考URL:http://ray.sakura.ne.jp/asm/9.html
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
関連するカテゴリからQ&Aを探す
おすすめ情報
- ・漫画をレンタルでお得に読める!
- ・人生のプチ美学を教えてください!!
- ・10秒目をつむったら…
- ・あなたの習慣について教えてください!!
- ・牛、豚、鶏、どれか一つ食べられなくなるとしたら?
- ・【大喜利】【投稿~9/18】 おとぎ話『桃太郎』の知られざるエピソード
- ・街中で見かけて「グッときた人」の思い出
- ・「一気に最後まで読んだ」本、教えて下さい!
- ・幼稚園時代「何組」でしたか?
- ・激凹みから立ち直る方法
- ・1つだけ過去を変えられるとしたら?
- ・【あるあるbot連動企画】あるあるbotに投稿したけど採用されなかったあるある募集
- ・【あるあるbot連動企画】フォロワー20万人のアカウントであなたのあるあるを披露してみませんか?
- ・映画のエンドロール観る派?観ない派?
- ・海外旅行から帰ってきたら、まず何を食べる?
- ・誕生日にもらった意外なもの
- ・天使と悪魔選手権
- ・ちょっと先の未来クイズ第2問
- ・【大喜利】【投稿~9/7】 ロボットの住む世界で流行ってる罰ゲームとは?
- ・推しミネラルウォーターはありますか?
- ・都道府県穴埋めゲーム
- ・この人頭いいなと思ったエピソード
- ・準・究極の選択
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
C# try-catch でcatchに飛ばす方法
-
【C#】アップロード時に「アプ...
-
winsock通信時エラーの回避
-
エラー 'ASP 0115'
-
AutoLoad()関数の使い方がわか...
-
C++でSQLServer2008に接続
-
このページの状態情報は無効で...
-
エラー内容について
-
FileCopy時のエラー
-
エクセルVBA 宣言Dimの場所
-
ASP.netで使用するWEBサーバに...
-
ActiveDirectoryで高い層のOUを...
-
「a.v.v」「iiMK」の...
-
PIC 外部クロックの使用について
-
画面のリフレッシュを意図的に...
-
ASP内で他のASPファイルを読み...
-
[PL/SQL]REFCURSORが戻り値のプ...
-
「Scripting.FileSystemObject...
-
ネットワーク上のPCのIPとホス...
-
VBSでIEを起動し、拡大率を変更...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
C# try-catch でcatchに飛ばす方法
-
FileCopy時のエラー
-
CreateObject("Excel.Applicati...
-
Outlookで添付ファイルの有無を...
-
fopenでエラーとなる
-
VBSからPDFファイルを開きたい...
-
このページの状態情報は無効で...
-
エラー 'ASP 0115' について
-
VB6でRDOに接続できない
-
EXECLマクロでshapeがグルーフ...
-
winsock通信時エラーの回避
-
VBA RemoveDuplicatesで「アプ...
-
ASP 0x80004005 クライアント...
-
ASP.NETで使用しているJavascri...
-
【C#】アップロード時に「アプ...
-
VBAでIE操作ができない ...
-
ASPプログラミングでADODB.C...
-
ジェネリックなメソッドでDirec...
-
型が一致しません
-
オラクル接続をopenしようとす...
おすすめ情報