|
Could you please show us a sample of where you are calling those operators?
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
One call is there in the <= operator.
Other is
<br />
const FpDate& rFpDateOperand1<br />
= (GetDateEvaluationValue(uliRecordNumber,<br />
ComparisonExpression::OPERAND_LEFT_SIDE,0));<br />
<br />
const FpDate& rFpDateOperand2<br />
= (GetDateEvaluationValue(uliRecordNumber,<br />
ComparisonExpression::OPERAND_RIGHT_SIDE,0));<br />
return (rFpDateOperand1 > rFpDateOperand2);<br />
Thank You
|
|
|
|
|
I am trying to determine if there is any way other than calling Show(), to force the creation of a handle for a form (or any control, for that matter). I have tried calling CreateControl(), which the docs claim will force handle creation (I presume it wraps to CreateWindowEx()), but no dice.
I need to alter some things before the form becomes visible, which are not just initialisation parameters like text and styles. That is, call control methods which require a handle to exist.
No matter how many CPU cycles pass, CreateWindow() simply returns and no handle ever gets created. Anyone have suggestions?
RSVP
|
|
|
|
|
Have you tried NativeWindow.CreateHandle
Cheers
Kannan
|
|
|
|
|
Thanks Kannan, that was a great idea. I was able to use my form's CreateParams to create a handle with the method you posted. Unfortunately, there does not seem to be a viable way to get a CLR form to attach to the created handle as in MFC/ATL, so I'm left with a raw window without child controls, which knows nothing of CLR stuff.
However, while subclassing I realised I could access the protected CreateHandle(), so I created a public method to call it externally. That worked, however it does not force handle creation for any of the child controls (as CreateControl() is supposed to), so I would have to subclass every one to create them too!
This is an aggravating bug, since non-visible form creation is simple in C/C++, and CreateControl() is supposed to do this too. I remain open to further ideas, and will report this bug to Microsoft (though I'm sure they've heard this one before).
Cheers
|
|
|
|
|
Hi all. I'm a new C++ programmer. Wonder if anyone know how to draw a tree graph with C++? without calling packaged libraries.
|
|
|
|
|
Hello,
I can't change the small icon from the Main Form with the following code in my project:
this->Icon = new System::Drawing::Icon("SAVE.BMP");
With this pice of code i get the following exception error
Unhandled Exception: System.ArgumentException: The argument 'picture' must be a picture that can be used as a Icon.
The same picture is working perfect if i use it for a menubar icon.
Many thanks for a good anwser
Peter.
|
|
|
|
|
Apparently, a System::Drawing::Icon can only be created from an .ico file, and not a .bmp file. There do not seem to be any Icon constructors that take a bitmap. I do not know how you managed it for your menubar icon.
Perhaps the easiest solution would be to copy the bitmap to an .ico file (via resource editor or other), then use the method you posted. Of course, with an .ico you could just set the form's icon from the propery settings, if you are integrated with C#. If you are purely MC++, I suppose you would have jump through a few hoops to compile the icon into a raw resource, and link it in to your executable. Supposedly VS.Net 2003 will make that ea$ier.
If you are mainly interested in converting a bitmap file to an Icon, you could alternatively do:
Bitmap *bmp = new Bitmap("MyIcon.bmp");<br />
this->Icon = Icon::FromHandle(bmp->GetHicon());
or...
Icon *ico = Icon::FromHandle(new Bitmap("MyIcon.bmp"));
Cheers
|
|
|
|
|
Both answers work Perfect )
I have used for the MenuBar a Image List,
I guess it was wrong thinking that a 'ico' file is a renamed
Bitmap file !!
Peter.
|
|
|
|
|
Hi!
I have a structure defined in my old unmanaged class, which is a output parameter of one of my methods. I want to create a managed C++ class which "wrappes" my old one.... the question is:
Which Marshall Type Conversion must I use in order to pass the information of this structure to my managed class and viceversa?
CODE
----------------------------------------------------------------------------------
void Extract( Feature* *MyFeature);
----------------------------------------------------------------------------------
Feature is the structure which is really the output of my method...
Thanks in advance!!!
|
|
|
|
|
Hello,
I'm sorry for bothering the members of the list but I really in need of some help from you guys. Actually I was involved in converting a C++ application (which was developed in MS VC++5) environment into a web service. I ported my application (infact a small version of the
actual application) to VC++.Net and it was working
fine in this environment. Just to make a point that I was
using Objectivity/DB (an OODB) on the backend so I've
to include its libs and headers in my code.
My idea was to convert my apllication in to a managed
C++ application and then to further convert it into a
web service. In order to make it a managed application
I complied my application with the "clr" option and
got some comiplation errors which later I sorted out with some efforts. But now I'm getting linker errors.
First of all, I need some comments from the members on the following questions.
Questions;
=========
1) Is VC++.Net mature enough to be selected for this
kind of problems?
2) Can I also use C# instead of VC++.Net in the above
mentioned scenario?
3) Can you help me in the present linking problem?
The source code is attached and following is the error
ecountered while linking the code.
Linking...
dbconnect.obj : error LNK2001: unresolved external
symbol "void __cdecl os_throw_length_error(void)"
(?os_throw_length_error@@$$FYAXXZ)
manDB.obj : error LNK2001: unresolved external symbol
"void __cdecl os_throw_length_error(void)"
(?os_throw_length_error@@$$FYAXXZ)
.\Debug/newTest.exe : fatal error LNK1120: 1
unresolved externals
Please see the code.......
NB. "dbconnect.h" & "dbconnect.cpp" are the actual
files used in VC5/6 env. whereas "manDB.h" and
manDB.cpp" are the wrappers for managed C++
extensions. Also note that i'm just trying to connect
to Objectivity/DB database.
----------------------------------------------------
dbconnect.h
-----------
//Objectivity/DB headers
#include <ooas.h>
class dbconnect
{
public:
dbconnect();
void start_transaction();
~dbconnect();
private:
ooTrans trans;
};
dbconnect.cpp
-------------
#include "dbconnect.h"
#include <iostream.h>
dbconnect::dbconnect()
{
ooInit();
}
void dbconnect::start_transaction()
{
trans.start();
cout << "Transaction started" << endl;
}
dbconnect::~dbconnect()
{
trans.commit();
cout << "destructor called" << endl;
}
manDB.h
-------
#include "dbconnect.h"
#using <mscorlib.dll>
using namespace System;
public __gc class Mclass
{
public:
Mclass();
~Mclass();
void m_start();
private:
dbconnect * m_pC;
};
manDB.cpp
---------
#include "manDB.h"
Mclass::Mclass()
{
m_pC = new dbconnect();
}
Mclass::~Mclass()
{
delete m_pC;
}
void Mclass::m_start()
{
m_pC->start_transaction();
}
void main()
{
Mclass * d;
d->m_start();
}
Thanks in advance for your co-operation/help.
Cheers,
M. Waseem Hassan
waseem
|
|
|
|
|
I am trying to write a managed C++ extension to be used with a project I am working on. All seems to work well except that .NET seems to refuse to recognize any fstream members, and I can't instantiate it. I include it in the stdafx.h. Any help would be greatly appreciated.
|
|
|
|
|
This should work fine - in my simple test I #include <fstream>, then instantiate a fstream object.
The types defined in fstream are in the std namespace. Does your code reflect this?
#include "stdafx.h"
#using <mscorlib.dll>
#include <tchar.h>
#include <fstream>
using namespace System;
int _tmain(void)
{
std::fstream fs;
fs.open("filename");
Console::WriteLine(S"Hello World");
return 0;
}
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2002 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Your code seems to work however, I am unsure of what file for the #using, I have tried the name of the built .dll in my case Test.dll, but I get the error "Could not find assembly Test.dll". Also if I include no filename, it expects one. I am new to Visual C++ .NET Managed Forums, and I would like to thank you for your patience.
|
|
|
|
|
Anonymous wrote:
I am unsure of what file for the #using
Nick didn't format it (;P), the following will need to be included for the source to work:
#include "stdafx.h"
#using <mscorlib.dll>
#include <tchar.h>
#include <fstream>
using namespace System;
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
Majid Shahabfar wrote:
How can I convert a managed object to unmanaged object.
For example a Byte(Managed) object to BYTE(Unmanaged)?
Byte to BYTE is easy :-
Byte b1 = 66;
BYTE b2 = b1;
For other types there are various techniques that can be used. If you list your specific requirements, people might be able to help you out.
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
I have more or less the same problem...
I have an unmanaged array of floats, for example "float p[x][y]" and i want to convert it to something managed... how should i do it????
Thanks in advance!
|
|
|
|
|
You will want to use members of System.Runtime.InteropServices.Marshal class for many managed to unmanaged and vice-versa conversions.
|
|
|
|
|
I have the following code that I am compiling into an assembly, it compiles fine and when I debug and step through it my i variable is always 0, however when I run the same query in SQL Query Analyzer I get a value of 1130, does anyone have any ideas as to what I am doing wrong here?
int mcpp::MyNumber::GetWebStat()
{
SqlConnection* mySQLConnection;
SqlCommand* sqlCommand;
SqlDataReader* dr;
String* sql;
int i;
try
{
sql = "select count(*) as myCount from site_stats";
mySQLConnection = new SqlConnection(S"server=Nick;database=DeveloperNotes;Integrated Security=yes;");
mySQLConnection->Open ();
sqlCommand = new SqlCommand(sql, mySQLConnection);
dr = sqlCommand->ExecuteReader();
i = Convert::ToInt32(dr->Item["myCount"]);
return i;
}
catch(Exception* e)
{
Console::Write(e->ToString());
}
__finally
{
mySQLConnection->Close();
}
}
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
Did you try the same program with C#, just making sure that there is no logical errors.
Cheers
Kannan
|
|
|
|
|
Kannan Kalyanaraman wrote:
Did you try the same program with C#, just making sure that there is no logical errors.
Good idea, I am not sure and will check when I get home.
Nick Parker
|
|
|
|
|
Until u say
Reader->Read(),
the pointer will not go to the first record so that's the reason u are getting 0.
try this
while(Reader->Read)
{
// your code.
}
|
|
|
|
|
Thank you, that was exactly what I needed.
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|
|
hiya is there a way to set a dos prompt to default another drive or directory instead of the c:\
thanks,
grahamoj.
|
|
|
|
|
from run in the start menu:
command /k d:
if you want to default to some directory, you can put it in a batch file.
test.bat:
d:
cd d:\mydir\thisone\
then do:
command /k test.bat
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|