|
Error 6 = ERROR_INVALID_HANDLE.
Do you have something like:
HMODULE hModule = LoadLibrary(...);
if (NULL != hModule)
{
fp = GetProcAddress(hModule, ...);
if (NULL != fp)
(fp)(function params here);
FreeLibrary(hModule);
}
|
|
|
|
|
Yes, in my application i use a dynamic call like yours....
But in my dll (first dll) i use a static linked dll (second dll, called from first dll)
|
|
|
|
|
It helps to use common terminology when describing a problem. Implicit linking is done at link time. Explicit linking is done at run time via LoadLibrary(), GetProcessAddress(), and FreeLibrary(). In the case of the latter, be aware of a hazard (from MSDN):
If the DLL has a DllMain() entry point function, the operating system calls the function in the context of the thread that called LoadLibrary(). The entry-point function is not called if the DLL is already attached to the process because of a previous call to LoadLibrary() with no corresponding call to the FreeLibrary() function. Explicit linking can cause problems if the DLL is using a DllMain() function to perform initialization for each thread of a process because threads existing when LoadLibrary() (or AfxLoadLibrary()) is called will not be initialized.
|
|
|
|
|
AnTri wrote:
static linked dll-function
That's the problem. You can free DLL's that you load with LoadLibrary by using FreeLibrary , but libraries that are implicitly loaded (e.g., you don't call LoadLibrary, you just have your DLL linked into your application) are, AFAIK, always loaded.
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
hi,
i started a little project and have little knowledge of c++ yet.
can someone explain me the basic steps to get access to the memory area of a certain process and write a few bytes, please?
i'm on win2000 here, but it would be nice if it works in w9x, too.
So, how do i get the base address of a process memory area?
i hope the memory i want to write is not protected, but i'll see.
thx in advance,
raffa
|
|
|
|
|
Some ideas off the top of my head: You can use memory mapped files or DDE or pipes or GlobalAlloc with the GMEM_SHARE flag or use Atoms or window messages.
onwards and upwards...
|
|
|
|
|
Take a look at this article:
http://www.codeproject.com/csharp/minememoryreader.asp
It's c#, but it uses win32 api.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thank you very much, thats the information i didnt find.
(searching the msdn can be pain in the arse
so back to work...
:up:
|
|
|
|
|
anyone know where I can find some coded audio wave compression algorithms? I'm looking to implement a wave compression program and I've found a couple of algorithms, but I'm trying to find a coded example so that I have something to work from.
It should include Predictor, Rice coding, and Lossless compression.
any suggestions are greatly appreciated. thanks!
|
|
|
|
|
Now i have the task to transfer document to PDF. For i should use the Chinese or Japanese font in the PDF, what should i do?
I look up the PDF Reference from Adobe website, but about the font using in the PDF i still do no know very well, especially the Chinese or Japanese font, did everybody know where have the correspoing article or material i could refer to?
Welcome any suggestion!
Thk u for ur help
Good Luck
|
|
|
|
|
As a native english speaker I have no idea what you are asking please revise your question. Do you need to create a pdf file from some other format? Are you trying to change the font in an existing PDF file? Do you have a copy of Adobe PDF Writer??
John
|
|
|
|
|
Looks like he wants to find out how to use Chinese/Japanese characters in PDF files, if they are supported, etc.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I got brain cramp reading his question trying to guess what he was asking for. I thhought if he could explain it better someone would be able to answer...
jdunlap wrote:
if they are supported
I know they are supported. I have seen PDFs with Japanese fonts.
John
|
|
|
|
|
Sorry for my poor english.
My question:
1. I need to write the code to transfer document to pdf.
2. And in our documents, need display Chinese or Japanese font
3. I need help, how can i implement the Chinese or Japanese font in PDF,such as Shift-jis charset.
Good Luck
|
|
|
|
|
hello friends,
Can any one tell me how can i programatically get the
SERVICE PACK installed on the Operating System.
I am working in VC6.0 enviroment.
i mean i want to know which is Service pack is installed for eg service pack 6a on NT4
Please Please
if anyone can help me....
Thanx in Advance
TAKE CARE
|
|
|
|
|
http://www.naughter.com/dtwinver.html[^]
[EDIT]
I know it is not clearly stated but it will also determine the service pack #. Run winver32.exe to see the result. The test program is in test.cpp.
[/EDIT]
John
|
|
|
|
|
Call GetVersionEx() and look at the szCSDVersion member of the OSVERSIONINFO struct. It will be set to "Service Pack n"
--Mike--
"I'm working really, really fast at the moment, so a 3 minute outage becomes, due to time dilation, a 5 minute outage."
-- Chris Maunder, relativistic system administrator
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Hi, everyone!
In a C style project, I think the advantage of a global static function
is its speed. But does it have any limitations? (Thread safety?)
If it does not have any limitations, I will define all of my global functions
and global variables as static.
Can anyone give me some advice of using global static function and global
static variable? Both advantage and limitations.
Thanks in advance,
George
|
|
|
|
|
George2 wrote:
advantage of global static function
is its speed
How do you know that?
From what I understand there is no difference in "C" whatsoever between global and static, except for linking.
In "C++" static is a tricky thing because of the order or instantiation etc for the variable. However "good" "C++" should not use global variables, or functions, so static is the only other way to go.
|
|
|
|
|
Thanks, AlexO buddy!
What is the difference between a static global function (variable) and
a non-static global function(variable) in your mind?
regards,
George
|
|
|
|
|
Terminology, terminology, terminology ...
In C, I have always seen "global" variables created in one of the source files and then all other source files that want access to that global variable use "extern". I have seen some people create those global variables in header files an use tricks with #define and #ifdef, but those end up being just tricks and overly complicate the simple concept that is being implemented.
As for functions, you can write a function and any source file can have access to that function as long as it includes the header file. Okay, go ahead, call these "global" functions.
In C, though, when you use "static" on a function or variable, this is supposed to mean that the function or variable is only visible within that single file.
Therefore, it would be impossible to have a "static global" function or variable, because to be "global" means everything can see it and to be "static" means it is only visible in the file where it is written.
Now, in C++, static functions and variables really belong to the "class" and not to the instantiations of the class. When dealing with "class" variables (as opposed to "member" variables) it also become difficult to think of these being "global." In C++, I have always seen "global" functions and variables to be declared outside of any class.
As for speed, I think this is a moot point, because those declarations affect visibility and access from other code elements and not the final implementation and conversion into executable code. An address of a function must still be known, obtained, and accessed regardless of whether the function is global, static, or something else.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
I was going to ask the same question myself. If there is a difference, with todays processors (pipelining) you probably will not see it at all.
As for threading there is no difference.
John
|
|
|
|
|
Thanks, John buddy!
Do you mean whether or not we add "static" before a function
in a C project has no difference at all?
What about cross-access about static function (variable) and non-static
function (variable)? Are they all legal?
regards,
George
|
|
|
|
|
David has the correct answer on this: http://www.codeproject.com/script/comments/forums.asp?msg=544541&forumid=1647&mode=all&userid=9241#xx544541xx[^]
I was just thinking about it in an optimization point of view and did not remember exactly what a static function in c was. My point is a lot of the old optimizations are unnecissary because of the way current processors work. At any one time many instructions are executing and if you can avoid branches most integer instructions take only one clock. My point is that worrying about something that can save you a few clocks on a machine that executes 4 billion clocks (2Ghz * 2 pipelines) in one second is pointless unless you are executint the function millions of times. If this is the case make the function inline..
John
|
|
|
|
|
The static keyword only affects the visibility of a function or variable - a static function/variable can only be used within the file in which it is defined. There is no difference in terms of speed. The only limitation is that you can't use them from multiple files. No function is thread-safe unless you make it so, by programming safely. static variables are no different to global variables in this respect - remember that static only affects which part of the program can access them. Once you compile the code, there is no different between using static and not using it.
Generally, using static is a good thing, because it provides more information about where the function is used - it helps maintenance programmers who may have to look at the code later, and tells them that the function/variable is only used within the one file.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|