|
Thank u for your response i think now i will start..
All the best
|
|
|
|
|
Rajesh R Subramanian wrote: You might as well consider learning C#.
If you want to be locked into Microsoft.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Tim Craig wrote: Rajesh R Subramanian wrote:
You might as well consider learning C#.
If you want to be locked into Microsoft.
Not really[^]
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Bunk! As long as Microsoft controls the game, no one else can compete with them and they know it. The whole "standards process" around C# and .NET is smoke and mirrors.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Remain stuck with C , the only programming language for real men (unless, well, you do need a job...).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
First learn C well. C is a subset of C++ (and C# somewhat) so when you're studying C, you're also learning C++. C is the fastest language of the three.
When you know C well, you can start with the parts of C++ that are extensions, such as the object-oriented features (classes, inheritance, virtual functions, etc). It's a smaller step from C to C++ than learning a totally new language.
Then when you're familiar with C++ and object-oriented programming, you can start C#, which is again a smaller step from C++ than a totally new language.
|
|
|
|
|
Hello,
1)How can I Defrag Individual Files ?
2)How can I Defrag Registry Hives ?
Thanks,
AD
|
|
|
|
|
Adnan562 wrote: 1)How can I Defrag Individual Files ?
If you mean the registry you can't; if you mean the disk then just right click on the drive in Windows Explorer and select Properties, and then Tools.
Adnan562 wrote: 2)How can I Defrag Registry Hives ?
You cannot do this unless you understand what each of the keys is for. Most software adds keys to the registry for its own purpose and any changes made by a user has the potential for creating complete chaos on your computer. The only sensible way to clean the registry completely is to reinstall Windows followed by all your application software. A rather extreme option I agree, but the only safe one.
|
|
|
|
|
|
Adnan562 wrote: I mean to say, to defrag via code.
What do you mean by defrag? Unless you understand the contents of the registry completely, and all the links and cross references between the different keys, you could end up in a total mess.
The Sysinternals people are experts with detailed knowledge of the internal systems of Windows, much of which is not published material. I assume you do not have such experience.
Adnan562 wrote: Can any provide link to article or API info ?
You have already provided the link; take a look at Mark Russinovich's article and the links he provides.
|
|
|
|
|
Registry Hives are in files, I know where it is.
Open PageDefrag,you will see the files.
The article link is dead.
AD
|
|
|
|
|
|
Thank you.
I will read.
AD
|
|
|
|
|
Hi @ all,´
i have the problem, i´m trying to send a message via UPD to a client but the select method reacts if the message is incoming on the client.
The client is running as a windows service.
With wireshark I can see the incoming message.
The client is waiting on messages following
while(g_bRun)
{
FD_ZERO(&fdSet);
FD_SET(g_pSipSocket->getSocket(), &fdSet);
rv = select(maxfd + 1, &fdSet, NULL, NULL, &timeVal);
AddDBS(1, "fdSet: %d\n", fdSet.fd_count);
if(rv > 0)
{
rv = recvfrom(g_pSipSocket->getSocket(), buf, sizeof(buf), 0, (SOCKADDR*)&sa, &salen);
if(rv != -1)
{
delay(100);
buf[rv] = '\0';
writeLog(buf);
}
}
}
the special clue is, if I´m sending a message to the client directly after starting my service then it works. If I´m waiting then or before ca. 2 - 3 minutes then the problem manner.
Sorry for my bad english
Best regards
Crazy
|
|
|
|
|
Premises:
1) jobject_instance is a reference to the correct object (another non-void method call worked just as expected), Type: jObject
2) j_method_id is the correct id for the called method, Type: jmethodID
3) Method expects one int as argument and is (of course) void
4) Code is compiled to DLL and used by external application
m_jni_env->CallVoidMethod(jobject_instance, j_method_id,(jint)n);
This results in: Runtime Error R6025, pure virtual function call. Any ideas?
Regards
|
|
|
|
|
Can you show the Java code for j_method_id and how you obtain its pointer?
|
|
|
|
|
Hi,
sure:
Getting the method id:
j_method_id = m_jni_env->GetMethodID(m_class_ref, "testMethod", "(I)V");
m_class_ref is the correct jclass reference, contructor call and another method using this reference are working as expected
and the Java code of the method:
public void testMethod(int n){
try {
this.debugOutWriter.write("testMethod called, n = " + Integer.toString(n) );
this.debugOutWriter.write("----------------------");
this.debugOutWriter.newLine();
this.debugOutWriter.flush();
} catch (IOException e) {
}
}
debugOutWriter is a BufferedWriter just used to test the entire jni stuff before actually implement the real functionality.
|
|
|
|
|
I've just compared this with my own JVM test system and all the calls and parameters look fine. I can only surmise that the external app or the DLL are somehow not in sync. If you call the Java function direct, rather than through the dll does that work? Also, are you sure the runtime error is on the call to the java method, rather than to some class method in the DLL?
|
|
|
|
|
Yes, using the class in a plain java application works just fine.
Directly in front and behind the JNI call for the void method are the following debug outputs ...
fprintf(m_debug, "calling java void method\n" );
fflush(m_debug);
m_jni_env->CallVoidMethod(jobject_instance, j_method_id,(jint)n);
fprintf(m_debug, "called java void method\n" );
fflush(m_debug);
... and the last entry in debug text file is "calling java void method".
But while playing with both, C++ and Java code to get closer to the reason of this error, I discovered that removing
this.debugOutWriter.write("testMethod called, n = " + Integer.toString(n) );
this.debugOutWriter.write("----------------------");
from the Java code solves the problem. Funny thing is, the file access does not seem to be the problem because the lines
this.debugOutWriter.newLine();
this.debugOutWriter.flush();
remain as they were and the "CR/LF"-newline is written into the file correctly. But using the write method is causing the error.
Even if this is only a debug output that won't be required in the final version, I'm still curious about it's origin.
File writing operations won't be required for real functionality, but file read operations and the Java2D framework, and I doubt that this is just a special attitude of the BufferedWriter class..
|
|
|
|
|
Well, I'm afraid I cannot figure out what is wrong with any of your code, it all looks fine to me. Sorry, but I'm unable to offer any further suggestions.
|
|
|
|
|
Thanks for your efforts anyway
I think I just figured out the problem:
The application I'm developping the DLL for seems to be multi-threaded and up to now I didn't attach/detach the current thread to the JVM.
Since the job to be done is linear and there's no gui I didn't thought of that (JVM is created in constructor, method calls are in the interface-method).
I have no idea why the void method without the write operations as well as the object returning method that's called earlier worked just fine without attaching the current thread (and this manner is reproducable!), but it's all working now
Once again, thanks for your effort!
|
|
|
|
|
Happy to help, and glad you found the problem.
|
|
|
|
|
Hi
How to convert Release Build to Debug build.I have a WorkSpase with release configuration ( Debug Multithreaded ).I have changed NDBUG to _DBUG , enabled Link incrementally and changed 'Debug info' to Program Database for Edit and Continue.Even then I am not able to Debug the application.Please Help
Thaks in Advance
|
|
|
|
|
Why can't you just debug the debug build itself instead? If you have a peculiar problem occurring only with the release build, then please read this: Debug vs Release[^]
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Benjamin Bruno wrote: I have changed NDBUG to _DBUG , enabled Link incrementally and changed 'Debug info' to Program Database for Edit and Continue.
Are you making all of these changes manually?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|