|
I think that you have included "ThreadProcedure.h" in "MainFrm.h" and now are trying to include "MainFrm.h" in "ThreadProcedure.h".
To get rid of it, either use #pragma once in both files, and include after it
or you can put both files include statements in stdafx.h, and include stdafx.h where needed.
Hope this will help 
|
|
|
|
|
Though MSDN explains the following error it doesn't give any solution,any pointers on this
Expression Evaluator Error CXX0069
Send Feedback
variable needs stack frame
The expression evaluator cannot evaluate the variable because it does not occur in a stack frame.
This can be caused by variables declared as part of an inline function.
Thanks
|
|
|
|
|
Check out [^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
I am getting this error in file afxcoll.inl in the following function and the code is breaking here,i am using Visual Studio 2005:
AFXCOLL_INLINE INT_PTR CPtrArray::Add(void* newElement)
{ INT_PTR nIndex = m_nSize;
SetAtGrow(nIndex, newElement);
return nIndex; }
The link you gave doesn't seem to be of any help.
Regards,
Mayank
|
|
|
|
|
Pls send me ur code. bcoz this is #include file.pls debug it properly.
are u using some add function in ur code ? please check it.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Can u pls check that the variable u declared locally is exceeded a bound.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Unless the program being debugged is currently executing in the scope of the variable, the variable value will display said error.
"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
|
|
|
|
|
hi all
i want to know that how can i know the system port number
as i need it for socket programming
thanks
|
|
|
|
|
p_ wrote: the system port number
If you want to know the standard ports (aka "well known ports"), you can find a list here[^]
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
thanks for ur answer sir
i use this code on a button but port which is in bold does not work
so please tell me what port number i should use
CAsyncSocket m_sListener, m_sConnected;
UpdateData(TRUE);
m_sListener.Create(port);
if(m_sListener.Listen()==FALSE)
{
AfxMessageBox("Unable to Listen on that port,please try another port");
m_sListener.Close();
return;
}
m_sConnected.Create();
m_sConnected.Connect("10.179.22.75",port);
if( m_sListener.Listen()== FALSE)
{
AfxMessageBox("Unable to Listen ,please try another port");
m_sListener.Close();
return;
}
thanks
|
|
|
|
|
p_ wrote: ...port which is in bold does not work...
Which is all but totally meaningless.
"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
|
|
|
|
|
Guy, if you don't know the port number of the service you're trying to connect to on the server, we're not going to be able to tell you. After all, you haven't said anything about this service so we don't know what it is you're trying to connect to!
|
|
|
|
|
Hello !
I was having some troubles with the use of COM ports on an embedded device (Pocket PC with windows mobile 5). I already opened a discussion here[^].
I finally decided to use WaitCommEvent to monitor incoming data but this doesn't seem to work as expected. The port that I'm working with is a virtual COM port which is provided by a Bluetooth stack when a Bluetooth connection is established. Here is the code:
int CSerialDriver::ReadData(char* szData, int MaxLenght)
{
DWORD dwMask = 0;
WaitCommEvent(m_hCOMPort,&dwMask,NULL);
if (dwMask & EV_RXCHAR)
{
DWORD dwRead = 0;
int Count = 0;
do
{
Count = MaxLenght - BytesRead;
ReadFile(m_hCOMPort,szData+BytesRead,Count,&dwRead,NULL);
BytesRead += dwRead;
} while ( dwRead && (BytesRead<MaxLenght) );
}
return BytesRead;
}
The comm mask is set when the port is opened:
SetCommMask(m_hCOMPort,EV_RXCHAR);
The problem that I encounter is that the WaitCommEvent doesn't work as expected: when I receive data, WaitCommEvent exit as expected but sometimes, all the data has not been received yet (which is logical). That's not a problem because my function will get called until all data has been received. The problem comes when I enter the function a second time and call WaitCommEvent, at this time it doesn't exit even if bytes have been received in between. Having read this article[^], WaitCommEvent should exit if bytes have been received in between.
Would it be possible that it is a bug in the driver supplied by the company that produce the Bluetooth stack ? Or did I do something wrong ?
Another question: it is stated in MSDN:
Only one WaitCommEvent can be used for each open COM port handle. This means that if you have three threads in your application and each thread needs to wait on a specific comm event, each thread needs to open the COM port and then use the assigned port handle for their respective WaitCommEvent calls. (see here[^])
So, that would mean that your application could open the COM port several time. I tried that on win32 but that doesn't work at all (each time I receive an invalid handle value and the GetLastError code is "Access is denied"). I tried with different access:
m_hCOMPortWrite = CreateFile(strPortName.c_str(),
GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
m_hCOMPortRead = CreateFile(m_strPortName.c_str(),
GENERIC_READ ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
Is there a difference here between win32 and windozs Mobile 5 ? Why do they state that you could open the port multiple time ?
Thanks in advance
|
|
|
|
|
//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/String;)V");
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 ! i got this LINKING TIME ERRORs
--------------------Configuration: ltry - Win32 Debug--------------------
Compiling...
Skipping... (no relevant changes detected)
tr.cpp
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/ltry.exe : fatal error LNK1120: 1 unresolved externals
// please help me sir....what chages i should do so that it gets run n calls java method ?
|
|
|
|
|
You probably are trying to create a Win32 application and you provide a main function instead of a WinMain. You should create a console application instead.
|
|
|
|
|
See here.
"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
|
|
|
|
|
Hi all,
I am new to VC++, I am developing an dll file using VC++, in this i want to put an entry in my windows registry. For example:
SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\test\\test , in this path i want to write some value in the key test.
Plese suggest me
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
Use RegCreateKeyEx for creating the path in the registry, the second parameter is where you'll set the path that you said. You can create the values in your registry by using RegSetValueEx. RegCloseKey will close the registry item that you opened.
|
|
|
|
|
Thanks for your suggestion. Dnt mistake me, plz give me some sample code's or link to learn this.
Thankyou once again
Know is Drop, Unknown is Ocean
|
|
|
|
|
|
Thankyou very much for your kindly help
Know is Drop, Unknown is Ocean
|
|
|
|
|
Exelioindia wrote: plz give me some sample code's or link to learn this.
Is that something you are incapable of?
"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
|
|
|
|
|
You can also try for -
CWinApp::WriteProfileInt/CWinApp::WriteProfileString and CWinApp::GetProfileInt/CWinApp::GetProfileInt
|
|
|
|
|
Thanks for your suggestion. Dnt mistake me, plz give me some sample code's or link to learn this.
Thankyou once again
Know is Drop, Unknown is Ocean
|
|
|
|
|