|
Go into your project properties, "C/C++" category -> "General" -> "Warning level".
By the way, exploring hte properties of the project doesn't hurt, it will learn you a lot of things of what you can modify in the options of your project
|
|
|
|
|
char str[200];
GetData(str);
CString sTemp = str;
the CString assignment works fine here if first character of str is not empty.
If str[0] ='' str[1] = 'a' etc... then after assignment sTemp contains empty string why?
|
|
|
|
|
The constructor of CString only reads till the empty character, that's why.
You can however do
CopyMemory(sTemp.GetBuffer(count), str, count);
sTemp.ReleaseBuffer(count);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
KASR1 wrote: str[0] =''
What do you mean with the above (i.e. it is NOT a valid statement, you know)?
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]
|
|
|
|
|
str[0]='';
error C2137: empty character constant(vc6.0)
str[0]='\0'; is right 
|
|
|
|
|
|
Hi,
I have a dialog based application. I have added the tree control on it. The tree implementation is done in separate class. I am getting the mouse click event in the class where I implemented tree control. I want the mouse click event to pass to dialog class i.e ..dlg to do some other operation. How to do this?
Thanks:-
Mike
|
|
|
|
|
You can insert below code to treectrl's mouse event function.
#include "YourDlg.h"
CYourDlg*dlg=(CYourDlg*)AfxGetMainWnd();
dlg->'Your function in your dialog class'
|
|
|
|
|
I define a class in a DLL(DLL1) and make a singleton using Loki library,for example:
class A
{
public:
......
void fun1();
void fun2();
.......
};
typedef Loki::<A> SingleA;
the singleton is used in DLL1.
I use SingleA::Instance() in another DLL(test dll) When I test DLL1,but all test failed.Why? How to resolve it?
|
|
|
|
|
Presuming you're actually using this code to define the singleton:
typedef Loki::SingletonHolder<A> SingleA;
then each module (DLL or EXE) that references A will have its own copy of hte singleton. This is because of how the 'static' keyword works in C++ classes.
If you want one singleton in the whole application, then provide an accessor that's exported from the DLL and declare the singleton in one of the source files in the DLL.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks!I have resolved it by the way as yours.
|
|
|
|
|
Hi! I've been using PeekPocket ( http://www.codeproject.com/KB/mobile/PeekPocket.aspx ) to scan Wifi stations and to get signal strenghts of each one.
It has two custom tabs. I've added a 3rd one, in which I send the lat/long (I've previously calculated) to googlemaps and it would show as a webpage.
The point is that the project is dialogbased and I dont know how to add a WebBrowser control in that 3rd tab.
I've read WebBroser control in Compact .NET ( http://msdn.microsoft.com/en-us/library/ms229657.aspx ) and it needs...
This example requires references to the following namespaces:<br />
<br />
* System<br />
* System.Windows.Forms<br />
If I add that namespaces could I get what I want?
What are the lines to add that namespaces?
Or if you have another idea to show a webpage in that application... )
Thanks in advance!
|
|
|
|
|
I am currently developing a GUI based application using MFC and C++. While I am far from done, I am trying to think a head to the testing phase. I have been told that Winrunner is the de facto standard for testing GUI based applications today. However, I have seen prices on the web for Winrunner in excess of 6000 dollars. That is way out of my budget. I am wondering if somebody could recommend a cheaper (or ever free) tool that is similar to Winrunner.
Thanks
Bob
|
|
|
|
|
Did you try the UWSC[^] tool. I havent used the Winrunner. so am not sure whether this tool will cover all the functionalities of the WinRunner or not.
Home page :http://www.uwsc.info/index.html[^] ( Its japanese )
|
|
|
|
|
nave,
Thanks for the response. I took a quick look at the tool and I am going to take a more in depth look at it. However, I still have a bunch of bugs that I need to fix. At the moment, these bugs are going to take priority over finding new bugs.
Bob
|
|
|
|
|
I am using WinUnit as test tool now, you try it.It's easy to use.
|
|
|
|
|
Hi All,
I'm a pretty experienced programmer but can't figure how to see the value of some variables when in debugger - either Watch Window or the Immediate Window (.NET 2008, C++).
The Watch Window lists them as :Out of Scope. At the least any variable passed into a function is not visible. Example:
void MyFunction(int x, Int32 y)
{
int i;
i = x * y;
}
i would be available but x & y are not. I've tried some project settings, optimization is off.
Any help?
|
|
|
|
|
I tried your example and the debugger could show the values of i, x and y. I am doing this in debug mode. I am not sure why you are having a problem. If you could post the entire program that might help. Not sure.
Bob
|
|
|
|
|
I presume the PC is pointing within the function? I compiled and linked your code and I was able to see the parameters.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
The breakpoint where the program has halted on is probably outside MyFunction.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hello,
I have an application which can start DLL. This DLL should open own window and output some data. I only know that using MessageBox it is possible, but I would like to have more advanced window. Can DLL do it or only application can open/control windows ?
If you have some example I would appriciate. I already tried and created cpp MFC code
with wizard for SDI application than tried to compile it as DLL but it failed.
Krzysztof
|
|
|
|
|
Check this[^] and this[^]
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
I tried according to article from codeguru but i dont have this in my source dll.
static AFX_EXTENSION_MODULE MY_DLL_NAMEDLL = { NULL, NULL };
I have
static char THIS_FILE[] = _FILE_;
Krzysztof
|
|
|
|
|
Hello all,
1. In VS, I've created a Square.cpp file which contains the following:
double square_in_C(double &arg) {return (arg*arg);}
2. I've created a .def file containing the following:
LIBRARY MyXLib
EXPORTS
square_in_C
3. I've added a Module to an Excel file containing the following:
Declare Function square_in_C _
Lib "C:/PATHTOFILE/debug/MyXLib.dll" (arg As Double) As Double
4. Cell B4 contains the number 4. Cell B6 contains "=square_in_C(B4)" (without quotes).
The result in B6: #VALUE!
Anyone know what I'm doing wrong?
Thanks
|
|
|
|
|
Can you debug into square_in_C() to see if the function is being called?
su_penguin wrote: Declare Function square_in_C _Lib "C:/PATHTOFILE/debug/MyXLib.dll" (arg As Double) As Double
Have you verified via Depends or Dumpbin that the exported function is named as you think it is?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|