|
Just curious, but when you set the text for a single line control, how many r\n\ were there?
How do I print my voice mail?
|
|
|
|
|
Well the text i'm printing with SetWindowText is just one single line thus the editbox doesn't contain any \r\n characters.
What do u mean "How do I print my voice mail?".
|
|
|
|
|
How to run LaunchWizard?
satya
|
|
|
|
|
|
Hi all,
I was wondering if someone can shed some insight into this problem i'm having. I am decent with C++ but very new to managed C++.
I have a managed c++ class library which wraps some unmanaged c++ code. At the moment i'm using a test harness which is a C++.NET Windows Forms Application project. (I have also tried writing the Test harness in VB.NET and C# but got the same error).
What happens is that when i start up the test harness, the form loads, but when i click the button to run the function i am testing from the class library, i get the error i have pasted below.
I have tried explicitly defining the path of the class library's output directory using the Reference Path project property, and have also tried copying the project output manually into the test harness' executable dir. ANd now i'm not sure what else to try!
Thanks in advance for any help/info..
idkrome
The error output is below:
----
'TestImagePreviewReaderCPP.exe': Loaded 'C:\Development\projects\PerforceRoot\CodeLibrary\ImagePreviewReader\Debug\ImagePreviewReader.dll', Symbols loaded.
'TestImagePreviewReaderCPP.exe': Unloaded 'C:\Development\projects\PerforceRoot\CodeLibrary\ImagePreviewReader\Debug\ImagePreviewReader.dll'
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in system.windows.forms.dll
Additional information: File or assembly name ImagePreviewReader, or one of its dependencies, was not found.
|
|
|
|
|
I am using VS-6.0 & C; Win-2000. I want to use the function SetDCBrushColor but when I compile the code I'm told this is an undeclared identifier. MSDN says that this is declared in Wingdi.h (use Windows.h) and is in GDI32.lib -- even though I am doing this (started with Windows.h already, and have tried adding Wingdi.h; GDI32.lib is in my project settings) I'm still not having luck. Any advice?
(this has happened on two machines, one set up at work and one I did at home ; if I open Wingdi.h I can see the function declared...but apparently my project does not?)
|
|
|
|
|
You need to have the _WIN32_WINNT macro defined as 0x500 or higher in order to use that function. The best place to do that is in your stdafx.h file.
#define _WIN32_WINNT 0x500
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi,
I am totally new to creating dlls . I've one doubt to be solved urgently --
For Windows -
There is a application which loads a dll, calls the dll's entry points and puts some data into the dll's data structures. Now there is another application which again loads the same dll and calls the dlls' entry point.
Is it possible to do the above in VC++. I am not aware so I may have put some terms very wrong. Pls correct me for that..
Any response greatly appreciated...
Regards
|
|
|
|
|
Your thought is absolutely vaild becasue each application loads the dll in its process space. I think it will work.
jitendra
|
|
|
|
|
I'm not sure to understand what you want to do.
Do you want 2 programs to use the same function of a dll at the same time or do you want the first program to modify datas that the second will use ?
The first is always possible.
The second is possible if:
- you use global variables (to stock your datas)
- the dll must "stay alive": you have to run the second program before the first one unloads the dll.It is very important otherwise your datas will be lost. There must be another way to do it better, but I know it works as I did it this way...
If the question was something else , then tell it...
|
|
|
|
|
I am writing some fairly simple code for a uni assignment and I have this error come up in a couple of instances "Declaration terminated incorrectly", I have checked the code over many times and just can't seem to work out the problem. The error occurs when I compile barDrv.cpp, and the error is in CustomerOrder.h on line 10. Here the code for the two files:
barDrv.cpp
//File: barDrv.cpp
//Test harness for assignment
#include <iostream>
#include "CustomerOrder.h"
#include "Bar.h"
static const int MAX_ITEMS_IN_CUSTOMER_ORDER = 15;
static const int MAX_ITEMS_IN_BAR_MENU = 40;
int main()
{
char choice;
int nextMenu = 1;
Bar theBar(MAX_ITEMS_IN_BAR_MENU);
CustomerOrder theCustomerOrder(MAX_ITEMS_IN_CUSTOMER_ORDER);
theBar.maintainStock();
do
{
theBar.printBar();
cin>>choice;
switch(choice)
{
case 'Q':
cout<<"Thankyou for using Tunerica Corporations software!";
nextMenu = 0;
case 'I':
int number;
theBar.printInclude();
cin>>number;
theCustomerOrder.includeItem(number, theBar);
case 'X':
int number2;
theCustomerOrder.printExclude();
cin>>number2;
theCustomerOrder.excludeItem(number2);
case 'P':
char whatToDo;
theCustomerOrder.printInvoice();
cin>>whatToDo;
if (whatToDo == 'Y')
theCustomerOrder.~CustomerOrder();
else
nextMenu = 0;
}
}while(nextMenu!=0);
return 0;
}
CustomerOrder.h
//File CustomerOrder.h
//Interface for the CustomerOrder class
#ifndef CUSTOMERORDER_H
#define CUSTOMERORDER_H
#include <string>
#include "Bar.h"
using namespace std; <<<<<-Where the error apparently is
class CustomerOrder
{
public:
CustomerOrder(int maxItems);
~CustomerOrder();
void includeItem(int choice, Bar aBar);
void excludeItem(int choice);
void printExclude();
void printInvoice();
private:
int numInInvoice;
int numItemsInvoice;
double calcTotal();
Item * * invoice;
};
#endif
Any help or suggestions would be greatly appreciated.
Thanks in advance.
|
|
|
|
|
1) Start by moving "using namespace std;" to the source file instead of the header file, because the header file is not the file that is using it (amongst other reasons).
2) Except that the syntax is C++, it looks like you think the case statement works that same as the simular constuct in VB. You must place a "break;" at the end of each case and before the next case.
3) This "theCustomerOrder.~CustomerOrder();" is a call to the destuctor of "theCustomerOrder", do not do this (EVER!). I've never seen anyone do this before!!!
Once you fix this problems, you may see your error disapear!
Good Luck!
INTP
|
|
|
|
|
Thanks for the reply, ended up figuring out what the problem was, I left the semi colon from the end of the Bar class.
|
|
|
|
|
Hi. I cant seem to find anything simple that will allow me to display a JGP (or Bitmap) on a dialog window. All I want to do is display 1 image on a dialog, thats it. If anybody has some code they would like to share to do this, that would be great!! I'm using MS VC++ (MFC exe).
Thanks alot!!
Boots
|
|
|
|
|
search for cpicture class here on CP, it does just that
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
I need to translate this code from Ansi C to C++, it copies everything from the file (except EOF or /n) to the string temp
<br />
string temp;<br />
<br />
FILE *arch;<br />
char c;<br />
<br />
arch=fopen(s,"r");
<br />
while (!feof(arch))<br />
{<br />
c=fgetc(arch);<br />
if ((c!=EOF) && (c!='\n'))<br />
temp=temp+c;<br />
}<br />
fclose (arch);<br />
i know the first line may be:
ifstream arch (s);
thanks
hope you can help me!!
|
|
|
|
|
#include <iostream>
#include <fstream>
#include <string>
using std::cout;
using std::cin;
using std::string;
using std::ifstream;
int _tmain(int argc, _TCHAR* argv[])
{
// I used a hard coded path
ifstream arc("c:\\ls.txt");
string s;
string file;
// check if the file is ended OR bad
while(!arc.eof() && !arc.bad())
{
// getline will get up to but not including the line break, which is what you were after.
getline(arc, s);
// each line is then added to the final result.
file += s;
}
// show the result
std::cout << file;
// this last bit is just to stop the window closing
std::cin >> s;
return 0;
}
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Apologies to Christian, but you can keep it just how it is and just change the file extension to .cpp.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
i hope you're kidding.....C != C++
|
|
|
|
|
I'm sure Joe was joking, but he does make a valid point, right?
C++ can be thought of as a superset of C, and although the original code does not make use of C++ specifics, it still is valid C++ code.
Can anyone verify or correct me in this? C++ is certainly not C, but C++ is backwardly compatible (or should be), to the standard ANSI C standard?
I Dream of Absolute Zero
|
|
|
|
|
no, that right...
except some particuliar cases, C++ IS a superset of C and so C code is understood and compiled by C++ compilers
TOXCCT >>> GEII power
|
|
|
|
|
fopen n stuff are CRT funtions they are available in c++ too.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
Please refer to Appendix B in the book "The C++ Programming Language, 3rd" by Stroustrup for...
B.2.2 C Code That Is Not C++, (Page 816)
B.2.4 C++ Code That is Not C. (Page 819)
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote:
B.2.2 C Code That Is Not C++, (Page 816)
B.2.4 C++ Code That is Not C. (Page 819)
No snippets
Awhh go on.. give us a clue what it says (briefly).
I Dream of Absolute Zero
|
|
|
|
|
RChin wrote:
No snippets
It's *A LOT* ~~~
Now you have some choices:
1) Go to a library to get that book,
2) Buy one (special edition) from a book store,
3) Download the whole book in pdf at HERE[^].
Don't tell Stroustrup that I posted his book in pdf here; otherwise he would probably spank me.
Maxwell Chen
|
|
|
|