Click here to Skip to main content
15,904,155 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: delete pointer. Pin
Hamid_RT13-Jun-06 22:51
Hamid_RT13-Jun-06 22:51 
Questionhow to know the values for event masks Pin
thathvamsi13-Jun-06 21:12
thathvamsi13-Jun-06 21:12 
AnswerRe: how to know the values for event masks Pin
Viorel.13-Jun-06 21:19
Viorel.13-Jun-06 21:19 
GeneralRe: how to know the values for event masks Pin
thathvamsi13-Jun-06 22:37
thathvamsi13-Jun-06 22:37 
AnswerRe: how to know the values for event masks Pin
Hamid_RT13-Jun-06 22:20
Hamid_RT13-Jun-06 22:20 
GeneralRe: how to know the values for event masks Pin
thathvamsi13-Jun-06 22:36
thathvamsi13-Jun-06 22:36 
QuestionOpen vc8 project using vc7.1 [modified] Pin
chybin13-Jun-06 20:55
chybin13-Jun-06 20:55 
QuestionError when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 20:50
RahulOP13-Jun-06 20:50 
Hi,

In continuance with my earlier posts,I can now link this dll and am also able to call some of its functions without any problems.
AVCodecContext *avctx;<br />
AVCodec *codec;<br />
avctx = new AVCodecContext;<br />
codec = new AVCodec;<br />
HMODULE hDll = LoadLibrary("avcodec.dll");<br />
if(hDll== NULL)<br />
{<br />
CString str;<br />
int a = GetLastError();<br />
str.Format("%d",a);<br />
AfxMessageBox(str);<br />
AfxMessageBox("first");<br />
AfxMessageBox("Failed loading1");<br />
}<br />
<br />
typedef void (avcodec_init)();<br />
avcodec_init* p = (avcodec_init*)GetProcAddress(hDll, "avcodec_init");<br />
if(p==NULL)<br />
AfxMessageBox("Failed loading2");<br />
p();<br />
//FreeLibrary(hDll);<br />
<br />
HMODULE hDll1a = LoadLibrary("avcodec.dll");<br />
typedef void (avcodec_register_all)();<br />
avcodec_register_all* p1a = (avcodec_register_all*)GetProcAddress(hDll1a, "avcodec_register_all");<br />
if(p1a==NULL)<br />
AfxMessageBox("Failed loading3");<br />
p1a();<br />
if(p1a==NULL)<br />
AfxMessageBox("Failed loading1.1");<br />
<br />
<br />
HMODULE hDll3 = LoadLibrary("avcodec.dll");<br />
typedef void (avcodec_find_encoder)(int CODECID);<br />
avcodec_find_encoder* p3 = (avcodec_find_encoder*)GetProcAddress(hDll3, "avcodec_find_encoder");<br />
if(p3==NULL)<br />
AfxMessageBox("Failed loading3");<br />
p3(CODEC_ID_MP2);<br />
if(p3==NULL)<br />
AfxMessageBox("Failed loading3");<br />
<br />
<br />
codec=(AVCodec *)p3;<br />
<br />
HMODULE hDll4 = LoadLibrary("avcodec.dll");<br />
//(hDll should not be NULL here)<br />
typedef void (avcodec_alloc_context)();<br />
avcodec_alloc_context* p4 = (avcodec_alloc_context*)GetProcAddress(hDll4, "avcodec_alloc_context");<br />
if(p4==NULL)<br />
AfxMessageBox("Failed loading4");<br />
p4();<br />
if(p4==NULL)<br />
AfxMessageBox("Failed loading4");<br />
<br />
<br />
avctx=(AVCodecContext *)p4;<br />
if(avctx==NULL){<br />
CString str;<br />
int a = GetLastError();<br />
str.Format("%d",a);<br />
AfxMessageBox(str);}<br />
avctx->bit_rate=64000;<br />

The last line throws the error and AfxMessageBox simply displays the number 2. The HELP section has no entry for 2.
Somebody please help!!
AnswerRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen13-Jun-06 20:59
Cedric Moonen13-Jun-06 20:59 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 21:09
RahulOP13-Jun-06 21:09 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen13-Jun-06 21:24
Cedric Moonen13-Jun-06 21:24 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 21:41
RahulOP13-Jun-06 21:41 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen13-Jun-06 21:50
Cedric Moonen13-Jun-06 21:50 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Eytukan13-Jun-06 22:11
Eytukan13-Jun-06 22:11 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 22:22
RahulOP13-Jun-06 22:22 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 22:16
RahulOP13-Jun-06 22:16 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen13-Jun-06 22:27
Cedric Moonen13-Jun-06 22:27 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP13-Jun-06 22:39
RahulOP13-Jun-06 22:39 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen13-Jun-06 23:14
Cedric Moonen13-Jun-06 23:14 
GeneralRe: Error when using libavcodec dll in vc++ [modified] Pin
RahulOP13-Jun-06 23:29
RahulOP13-Jun-06 23:29 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP14-Jun-06 21:00
RahulOP14-Jun-06 21:00 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Cedric Moonen15-Jun-06 1:24
Cedric Moonen15-Jun-06 1:24 
GeneralRe: Error when using libavcodec dll in vc++ Pin
RahulOP15-Jun-06 2:53
RahulOP15-Jun-06 2:53 
GeneralRe: Error when using libavcodec dll in vc++ Pin
Eytukan13-Jun-06 22:27
Eytukan13-Jun-06 22:27 
AnswerRe: Error when using libavcodec dll in vc++ Pin
Viorel.13-Jun-06 21:00
Viorel.13-Jun-06 21:00 

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.