|
I am a beginner of .Net progamming and I've got a C# project which needs to render PDF documents. I can create a Gdiplus::Bitmap object for each PDF page in unmanaged C++. I wrote a managed C++ wrapper class in which I tried to convert the pointer of Gdiplus::Bitmap to the pointer of System:: Drawing:: Bitmap, but I got the error message -- error C2440: '=' : cannot convert from 'Gdiplus::Bitmap *' to 'System:: Drawing:: Bitmap __gc *'
Thanks in advance.
|
|
|
|
|
i really need an answer to this question.. please help me..
|
|
|
|
|
You can find out about all the hardware on the computer in two ways :
1. From Windows Registers
2. Test for hardware yourself
I recommand you option no. 1. For this option I do not know the exact answer but try searching the internet, and in the meantime, look into the HKEY_LOCAL_MACHINE.
I hope you understand...because is a rough world out there...
|
|
|
|
|
Teacher: The Teacher asked the student to write
"I Will Not Throw Paper Airplanes in the Class"
500 times.
Student:
#include <stdio.h>
int main(void)
{
for(int count=0; count<=500; count++)
printf("I Will Not Throw Paper Airplanes in the Class\n");
}
-- modified at 3:05 Thursday 1st September, 2005
|
|
|
|
|
the student is so enthusiat that he's gonna print the line 501 times !!!
he should not use <= but <
anyway, i like it
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 5:12 Thursday 1st September, 2005
|
|
|
|
|
If I write 500 times One time free.
500 times is for Teacher.
One is for him.
Thanks for reply.
|
|
|
|
|
A real C++ geek would write it this way:
fill_n(ostream_iterator<string>(cout, "\n"), 500, "I Will Not Throw Paper Airplanes in the Class");
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
|
I have in my project a template class. When I try to use a method in that class, then i get error messages like that:
C:\My Documents\tel_op3\tel_op3\info_dlg.cpp(14) : error C2228: left of '.setFilename' must have class/struct/union type
What could be the problem?
Thanks,
Chen
|
|
|
|
|
Include the header file of the class in the cpp file.
If this doesn't work, give more details because it is impossible to know what's happening with so little clues.
|
|
|
|
|
I included the header file of the template class in the header of the class that use it, adding it to the cpp file doesn't help
(i get the same error messages). Details: I wrote a template class that represent a list of objects. this it's definition:
<code>template< class T >
class obj_list
{
public:
obj_list();
virtual ~obj_list();
void addObject(T *object);
T getObjectAt(int i);
void saveObjects();
int getNumOfObjects();
void close_file();
void setFilename(char *fileName);
private:
char* file_name;
CObList objects;
POSITION pos;
CFile objects_file;
int numOfObjects;
};</code> It's implication came in the same header file (i heard that when i writing a template class I need to put the definition and
implication in the header file). I have a class named info_dlg, and in it's header file I create a variable of the type of
obj_list, by writing this line:
obj_list<user_info> user_s();
(user_info is a class that hold information about a user). In the cpp of info_dlg, I have some methods that in them I try
to use some of obj_list's methods, but i get error messages like that:
C:\My Documents\tel_op3\tel_op3\info_dlg.cpp(14) : error C2228: left of '.setFilename' must have class/struct/union type
C:\My Documents\tel_op3\tel_op3\info_dlg.cpp(21) : error C2228: left of '.saveObjects' must have class/struct/union type
C:\My Documents\tel_op3\tel_op3\info_dlg.cpp(41) : error C2228: left of '.addObject' must have class/struct/union type
I hope this is enough details, and you could help me.
Chen
|
|
|
|
|
Hi, Does any one know of a tool that can be used to extract/copy public members of a class(and possibly certain specified protected/prvte members) into a new class declaration(with same class name) in a new header file, given a header file with declaration of the existing class.
For example:
Given .h file with a class declaration below:
---file classA.h----
classA{
public:
void a1();
void a2(int n);
protected:
void a3();
int m_n;
};
---file classA.h----
Want a new .h file with the following class declaration:
---file classA_r.h----
classA{
public:
void a1();
void a2(int n);
};
---file classA_r.h----
We need such a tool so that when we provide the header files of classes in our library to the clients, we want to hide any protected/prvt members and show only the public members they need. We can do this by hand but if there is a tool it will be greatly helpful to create large number of new modified header files from existing ones. Preferably the tool should work with/in VisualStudio.NET 2003 IDE and preferably free.
Thanks
-- modified at 11:02 Thursday 1st September, 2005
|
|
|
|
|
Grettings all,
Another GDI+ question...
GDIPen is used to draw path. Lets say I have 2 paths on canvas and i would like to cmbine them.
I create regions from paths, then combine regions. The result is displayed with a filled region. I originally used GDIPen, but th result is filled now ( which is not something I would like to happen). Can someone advise if there is a better way to get the result I need?
Thanks in advance
Sincerely,
Max Pastchenko
|
|
|
|
|
Hi,
I got some unexpected trouble when I tried to write a managed wrapper around a native dll.
This is what I did:
1) wrote a wrapper in C++/CLI and compiled it into dll file (with /clr switch)
2) created project in C# and added reference to a wrapper
3) in C# I created instances of some classes from my wrapper, everything compiled fine
4) when I ran C# project I got FileLoadException saying: A procedure imported by [assembly name] could not be loaded.
Any ideas what might cause FileLoadException?
This is a simplified C++/CLI code which I used for testing and got the same problem as described above:
<br />
<br />
#pragma once<br />
<br />
#include <irrlicht.h><br />
#pragma comment(lib, "Irrlicht.lib")<br />
<br />
<br />
using namespace System;<br />
using namespace irr;
<br />
<br />
namespace test<br />
{<br />
public ref class Class1<br />
{<br />
public:<br />
<br />
void Foo(void)<br />
{<br />
System::Console::WriteLine("blah blah blah");<br />
}<br />
<br />
void Bar()<br />
{<br />
IrrlichtDevice * dev = createDevice(); <br />
}<br />
<br />
};<br />
}<br />
--
moose
|
|
|
|
|
Show us the code for the wrapper. That's probably where your problem is.
|
|
|
|
|
I wrote a template class that represents objects list. This is its header:
<pre>template< class T, char* filename >
class obj_list
{
public:
obj_list();
virtual ~obj_list();
void addObject(T *object);
T getObjectAt(int i);
void saveObjects();
int getNumOfObjects();
void close_file();
private:
CObList objects;
POSITION pos;
CFile objects_file;
int numOfObjects;
};</pre>
When I want to create an object of the type of this class, by writing this line:
<pre>obj_list<user_info,"user_list.dat"> users</pre>
I get this error message:
c:\my documents\tel_op3\tel_op3\info_dlg.h(19) : error C2964: invalid expression as template parameter
that point on that line
and that error message:
c:\my documents\tel_op3\tel_op3\obj_list.h(13) : error C2973: 'obj_list' : invalid template argument 'filename'
that point on the first line in the header (the one that conation '{')
The template class passes the compile without any error message.
What is wrong and how can i fix it?
Thanks in advance,
Chen.
-- modified at 6:18 Wednesday 31st August, 2005
|
|
|
|
|
use the [Modify][^] link at the bottom of your post to edit it, and the, uncheck the 'Do not treat <'s as HTML tags' check box.
moreover, put the code inside a <pre></pre> block to let us benefit of the indentation...
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 6:13 Wednesday 31st August, 2005
|
|
|
|
|
I can't get my delegate/event to work. It keeps giving me a compiler error of 'the specified function does not match the delegate type'. This is what I have:
...
public delegate void MessageReceivedEventHandler(MessageDetails^ Message);
...
ref class CodeProject<br />
{<br />
public:<br />
event MessageReceivedEventHandler^ MessageReceived;
...
...
CodeProject^ m_codeProject;<br />
m_codeProject->MessageReceived += gcnew MessageReceivedEventHandler(&NS::MessageReceived_Message);
...
private: System::Void MessageReceived_Message(MessageDetails^ Message);
It seems that everything is fine but it won't compile. Please help.
Thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
Is void the same as System::Void ? I doubt it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
actually it is the same when it comes to managed but I found the answer. It turns out that when I add a new event I have to pass in the class that's calling the event:
...
m_codeProject->MessageReceived += gcnew MessageReceivedEventHandler(this, &NS::MessageReceived_Message);
...
thanks!
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
hi all
i wanted to know how to implement an undo for my application?
do i have to store for every change the whole data???
if yes what if the data is too huge ??
if no , how?
|
|
|
|
|
|
very good article Nemanja Trifunovic
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Does anyone know a free C++ .NET complete tutorial in English or Italian? Note that I already develop with the other .NET languages...
Thanks for sugestions.
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is obliterating us.
|
|
|
|
|