|
Thanks for the reply.
The required space is luckily not really near the 32K. It's just that I have a bug with some rather big strings 9+K not passing over a socket connection and I just wanted to make sure that the CString was not the cause of it.
Greetings,
Davy
|
|
|
|
|
GDavy wrote: It's just that I have a bug with some rather big strings 9+K not passing over a socket connection
String length isn't the problem, but what's going on with your sockets?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Matthew Faithfull wrote: From memory 32767.
Sounds like you need a memory update.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
My 250TB is just fine. If only I could find the runtime to re-index it
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
because of implementation: MAX_INT - 1 = 2^32 - 1
Greetings from Germany
|
|
|
|
|
Can you say why do you need to max length of CString,please?
|
|
|
|
|
hi, everyone! i add my own button in windows explorer (windows vista), but i want to put on my button bmp picture, but vista style glass blur my bmp picture. how can i avoid it? how can i control relationship between parent & child windows in case of glass?
I use dwmapi , but it doesn't help me.
Thanks for any help.
|
|
|
|
|
I have exceptions being thrown from two locations within my code, both of them are predefined tree view macros.
TreeView_GetItemRect()<br />
TreeView_GetItem()
If I change the first macro to it's SendMessage() equivlent, the exception is no longer thrown, but as for the second macro I just cannot get it working as it should.
Has anybody come across this before? Google has been of little help to me.
Waldermort
|
|
|
|
|
Go to your compiler debug setting and turn on, "break on 1st exception" for all exceptions type.
Run the program again from the debugger and cause the exception to get thrown.
As soon as the exception is thrown, your code will break and you will be able to tell from the call-stack who is throwing the exception! Inspect the code and figure out why this is happening... are you doing something wrong? did you fail to init something? etc, etc.
You will need to do some work, hope this helps!
---
Yours Truly, The One and Only!
web: devmentor.org
Design, Code, Test, Debug
|
|
|
|
|
It was a bug in my own code ( no surprises there ). I wasn't correctly checking the hWndFrom member within the WM_NOTIFY handler which ended up causing the code to do a custom draw on the incorrect window.
Waldermort
|
|
|
|
|
Always feels good to find the bug
---
Yours Truly, The One and Only!
web: devmentor.org
Design, Code, Test, Debug
|
|
|
|
|
How are you calling them?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The problem was due to casting the LPNMHDR into a control specific struct without first checking which control sent the message. A novice mistake which I am highly embarassed about
Waldermort
|
|
|
|
|
Thats to little to understand your problem. Most common problem of treeview issue are that the handles or other parameters are invalid.
Greetings from Germany
|
|
|
|
|
Hi friends,
I have a query regarding Menu.
My project is a Dialog Based Application. It contains a menu which contains 7 fields (top level menu like File, Edit, View, Favorites etc). Each toplevel field doesn't have any menu items or sub-menus. I want to disable some of them at run-time based on an event like pressing a button control etc.
Please help me.....
Thanks in advance
Sairam
|
|
|
|
|
Try GetMenu()->EnableMenuItem( 1, MF_GRAYED | MF_BYPOSITION );
- NS -
|
|
|
|
|
I am not sure, but in View/Doc programms. The menu depends on the active window. If the active window doesn't have a function of the menu in it, then the menu option is grayed automatically.
In the worst case, you can design more than one menu, and switch between them according to the actual window.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Using ColeDatetime i am able to get system time ... can anybody help me how to find out User name logged in to the system.. I checked Registry also but i m not getting any clue..
help needed..
Megha
|
|
|
|
|
|
thank u dear.. it worked.. thanks
|
|
|
|
|
Welcome
- NS -
|
|
|
|
|
Hi,
I have an application which writes data(e.g strings) to the events log.
Now,I need to write an application which reads the data from the events log at the same time that
the first application write the data(i.e Logger).
In that application I want to create 2 threads:
The first thread will read the data from the events log,put the data(EVENTLOGRECORD) in a message,
and send it to the other thread.
The second thread will receive the message from the first one,decode it and dispaly the data in a list box.
My questions are:
1. Which is the best (and effective) way to send messages between threads?
2. In the second thread(the one which responsible for the display) - how does the thread receive
those messages?
Do I need to call PeekMessage() and DispatchMessage() in a loop?
I heard about WaitForSingleObject() option,but I didn't understand how to use it...
Can anyone point me to a good tutorial about messages between threads?
I googled a little but could'nt find something usefull...
With best regards,
Eli
|
|
|
|
|
You will need to create an Event object and then use WaitForSingleObject on the event object to notify the read thread that it's ok to wake up and started reading.
The log buffer will need to be protected using a critical section, so that the writer thread is blocked from writing to the log while the reader thread is still reading.
Once the reader thread is done, it exits the critical section and then goes back to waiting on the event object.
---
Yours Truly, The One and Only!
devmentor.org
Design, Code, Test, Debug
|
|
|
|
|
If the threads belong to the same process, you can make a global structure, and can share the object of the struct in both threads for communication. In this case you need not to call PeekMessage and DispatchMessage.
You can also use PostThreadMessage. In this case the thread to which the message is posted retrieves the message by calling the GetMessage or PeekMessage function.
When a running program encounters WaitForSingleObject(), it waits untill the given thread/object does not enters in the signaled state or the time-out interval elapses.
|
|
|
|
|
i am using jdk1.4 and vc++ 6.0 console application !
//Its tt.java simple Helloworld program .which i am willing to call from c++
// i created .class and .h file of it !
public class tt {
public static void main(String[] args) {
System.out.println("Hello World ");
}
}
//*****************************************************************************************
//i wrote it in vc++ 6.0
//for this i added path of tt.h(created using javah) in preprocessor path(underprojects=>setting=>c/c++ tab)
//then added path of jvm.lib (under projects=>setting=>link tab)
#include "jni.h"
#define PATH_SEPARATOR ';' /* define it to be ':' on Solaris */
#define USER_CLASSPATH "C:\j2sdk1.4.2_05\bin" /* where tt.class is */
int main()
{
JNIEnv *env;
JavaVM *jvm;
jint res;
jclass cls;
jmethodID mid;
jstring jstr;
jclass stringClass;
jobjectArray args;;
JavaVMInitArgs vm_args;;
JavaVMOption options[1];
options[0].optionString ="-Djava.class.path="USER_CLASSPATH;
vm_args.version = 0x00010002;
vm_args.options = options;
vm_args.nOptions = 1;
vm_args.ignoreUnrecognized = JNI_TRUE;
/* Create the Java VM */
res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
if (res < 0) {
fprintf(stderr, "Can't create Java VM\n");
// exit(1);
}
cls = (env)->FindClass("tt");
if (cls == 0) {
// goto destroy;
}
mid = (env)->GetStaticMethodID(cls, "main","([Ljava/lang/StringV");
if (mid == 0) {
// goto destroy;
}
jstr = (env)->NewStringUTF(" from C!");
if (jstr == 0) {
// goto destroy;
}
stringClass = (env)->FindClass("java/lang/String");
args = (env)->NewObjectArray(1, stringClass, jstr);
if (args == 0) {
// goto destroy;
}
(env)->CallStaticVoidMethod(cls, mid, args);
//destroy:
if ((env)->ExceptionOccurred()) {
(env)->ExceptionDescribe();
}
(jvm)->DestroyJavaVM();
return 0;
}
/// After doing that much ! program gets compiled easily but at run it says JVM cant created and returns error value -1 means unknown error (as per jni.h)
// please help me sir....what changes i should do so that it gets run n calls java method ?
|
|
|
|