|
Cedric Moonen wrote: Is it a simple dll or an activeX ?
VB can produce only activeX ones.
|
|
|
|
|
Hi,
can we use return statement in "?:" conditional ternay operator.
I am using like this (avar == 2)?return:executesomethng(..);
but the compiler is not allowing me do that, and it gives the error C2059(syntax error : 'token').
Regards,
Mushq
|
|
|
|
|
Either way, in my opinion you're putting a lot of time and effort to write code that is hard to read and understand, even for yourself if you return to it two months from now.
My suggestion is that you rewrite it: use an ordinary if-statement.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
A well written method would have only one return point. The way to do this is,
if (avar != 2)
{
executesomething(..);
}
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
(avar == 2)?return:executesomethng(..);
err am i missing something here or should this be:
(avar == 2) ? return executesomethng(); : return executesomethngelse();
"Life begins at 140"
|
|
|
|
|
Actually, I agree that there should be just one return, and the correct syntax for what you're trying would be
return (avar == 2) ? executesomething() : executesomethingelse();
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I have somewhat of a strange problem. When I create a window for use with D3D the systems appstarting cursor is set in place when really it should be a normal pointer. I do not programaticaly change the cursor in any way. I have tried showing/hiding the cursor from both IDirect3DDevice9 and the standard api, so far I have been unable to change this behaviour.
I could set the cursor myself but why should I?
Another point to note is that I am using the October 2006 SDK on windows vista
|
|
|
|
|
Hi!
Is there a good reliable way to determine how much memory is in use by my process?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Mr David Crow has an article about process on the codeproject Im not sure its your answer or no but see it
|
|
|
|
|
You need to use a performance counter.
Either do this using code, or use Perfmon.
|
|
|
|
|
Let me clarify -- from inside my process.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
With performance counter he can see a lot of detaily of his process(Working set/handle/thread/priority,Mem usage ,...);)
|
|
|
|
|
See if this helps.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You cna 'walk' your entire use of memory using VirtualQuery.
The status returned for each block of memory used tells you if it is read/write, executable, image, etc.
|
|
|
|
|
Hi,
I am not sure if this is the correct forum to post this question.. pardon me.
I created a DLL using VC++6.0 with 3 functions in it.
Now i am using VC++.NET 2003 and i want to import this dll and use the functions. but it prompt me unresolved external symbol.
i have no clue what happen.
any solutions?
or anyone know how to import VC++ dll in VC++.NET 2003?
thanks.
regards,
terr
|
|
|
|
|
Have you linked the .lib for that dll in to your project ?
|
|
|
|
|
hi. tks for the reply.
hmm.. what i did was:
1. i paste the dll file in my debug folder of my VC++.NET application
2. i added the dll.h ( header file ) into my application.
3. i place the dll.lib in the debug folder as well.
4. go to my linker-> additional dependencies-> i included the path to the dll.h
so in my application, i want to use the dll function, eg. installhook()
it prompt me unresolved external symbol
" error LNK2019: unresolved external symbol __imp__installhook referenced in function "public: __thiscall CChildFrame::CChildFrame(void)" (??0CChildFrame@@QAE@XZ)"
in my dll.h, the code is as follows:
------------------------------
#ifdef KEYDLL3_EXPORTS
#define KEYDLL3_API __declspec(dllexport)
#else
#define KEYDLL3_API __declspec(dllimport)
#endif
KEYDLL3_API void installhook(HWND h);
KEYDLL3_API void removehook();
KEYDLL3_API LRESULT CALLBACK hookproc(int ncode,WPARAM wparam,LPARAM lparam);
----------------------------------
what steps did i missed? or the way i link my dll is wrong?
can help? tks.
rdgs, terr
|
|
|
|
|
bengz wrote: 4. go to my linker-> additional dependencies-> i included the path to the dll.h
You need to give .lib path , not headers.
|
|
|
|
|
hi, thats was a typo.
i did entered the path to the dll.lib
so any clues why it still prompt me unresolved external symbol?
also, i never include this dll.lib path, it will prompt me that dll.lib cannot be open. so the program did open the dll but cant recognised the functions. why?
any clues.. need help.
tks
|
|
|
|
|
Did you include lib file (right click on your project and select property then select linker->Input->Additional Dependencies)
|
|
|
|
|
hi. tks for the reply.
hmm.. what i did was:
1. i paste the dll file in my debug folder of my VC++.NET application
2. i added the dll.h ( header file ) into my application.
3. i place the dll.lib in the debug folder as well.
4. go to my linker-> additional dependencies-> i included the path to the dll.h
so in my application, i want to use the dll function, eg. installhook()
it prompt me unresolved external symbol
" error LNK2019: unresolved external symbol __imp__installhook referenced in function "public: __thiscall CChildFrame::CChildFrame(void)" (??0CChildFrame@@QAE@XZ)"
in my dll.h, the code is as follows:
------------------------------
#ifdef KEYDLL3_EXPORTS
#define KEYDLL3_API __declspec(dllexport)
#else
#define KEYDLL3_API __declspec(dllimport)
#endif
KEYDLL3_API void installhook(HWND h);
KEYDLL3_API void removehook();
KEYDLL3_API LRESULT CALLBACK hookproc(int ncode,WPARAM wparam,LPARAM lparam);
----------------------------------
what steps did i missed? or the way i link my dll is wrong?
can help? tks.
rdgs, terr
|
|
|
|
|
Did include dll.lib file to linker-> additional dependencies
|
|
|
|
|
hi..
i did include the C:\dll.lib into the additional dependencies.
it prompt me the unresolved external symbol ( for the functions that i used. )
you know why?
is it because the dll was created using VC++6.0 and i use it in my VC++ .NET 2003 ?
is there any special codes that i need to add?
tks.
|
|
|
|
|
hi tks. i managed to solved the error.
I redo the whole steps again.
tks.
|
|
|
|
|