|
Somehow I dont think you can managed Managed Extensions for C++....
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
How can I read a number from a text file?
Mayber there are two numbers in an text file,:
4578 8956
How can I read it as tow numbers: 4578, 8956 respectively?
Thank you!;
|
|
|
|
|
Hi everybody,
Can anybody help me by sending some examples of how to read XML in C++ using SAX ?
Basically, i want to read XML in C++ using SAX and based on the data got from the XML i want to call some C++ functions developed by me.
Thanks in advance,
ADARSH
S.E.Biz Infotech Pvt. Ltd.,
Chandigarh
|
|
|
|
|
|
when I #include "windows.h" and #include "mmsystem.h"
and build my program it will be orcurr an error :
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(99): error C2371: 'IServiceProvider' : redefinition; different basic types
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(92): error C2872: 'IServiceProvider' : ambiguous symbol
help me how to fix it, because i want use mciSendString to play an audio file.
thanks
Nho'c Ti`
|
|
|
|
|
Hi' im used to c#, and c++'s excessive use of tabbing in and nextlinning is erking me.
For example. instead of like this (note "......." is just cause im tryin to tabe this stuff over)
private:
.......System::Void button1_Click(System::Object * sender, System::EventArgs * e)
.......{
.......Form2* f =new Form2();
.......f->Show();
.......}
i want it like this!
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
.......Form2* f =new Form2();
.......f->Show();
}
Also, is their any way to make everything lineup proper when you type the closing bracket } , like in c# it auto tabbed in stuff to make it neat and speeded up my work... I need these things to use this managed c++ or im gonna freak.
Lastly, whats the equlivaant of #region and #endregion, cause i got all this code i want to conver to c++ managed, and i used that thing tons of times to make my code neat
|
|
|
|
|
I am writing a game addon using .NET in managed code. I have a struct that has a few char[64] entries to be compatable with the unmanaged sections of my code. I want to open a file and either read or write using the char[64] characters. I tried using StreamReader, but it only returns managed type code (String* or __wchar_t) and can't write to the char[64] members. There are also some doubles, ints and bools that need to be read/written. I tried using iostream but it doesn't seem to work because of multiple errors with the header. How can I do this?
James Meade
vLT(jg) vUSN
vOPSOFF VAQ-140
|
|
|
|
|
he mate..how r ya....call me dj_oden okay...just see me as a passer by and a stranger ..so dont need to know my name....anyways for an answer to what you've said...i have a perfect script for you...it's based on...tri overlooping...so at that point...you can get it to operate in many oss....os/1 or os/2 even...anyways...i cant sendit to you ....from here..so maybe you can give me your email addy..that'll be good...or you can contact me on ...crypto_000@hotmail.com
dj_oden@$%$&^highlander
|
|
|
|
|
hi james...
are you getting link errors or compile errors?
i am trying to do the same thing and everything works ok, but i get a heap of LNK2020/LNK2019 errors etc...
cheers
nik
Nik Vogiatzis
PhD Candidate: University of South Australia
+++++++++++++++++++++++++++
Developing new generation Traffic Micro-simulation Tools for Traffic Engineers
em: nikolaos.vogiatzis@unisa.edu.au
|
|
|
|
|
hi james,
ok, i think i worked it out...
below is some code i wrote to do basically the same thing...
unsigned int c, c2;
BinaryReader *br;
br = new BinaryReader(File::OpenRead(sFilename));
c = (unsigned int) br->ReadByte();
c2 = (unsigned int) br->ReadByte();
now in my case i need to know at what point in the code i am as i get records from traffic control systems, and they give you the record length LOB as a 2-byte field followed by the actual data, however, if you don't need this capacity, then you can use the ReadByte function until you get to the end of the file...
what i did is wrap the whole thing in a try/catch block as if you attempt to read passed the EOF it will throw an exeception, so that is a good way to get out of any read loop you may have and then use it as an excuse to close the file...
anyway, hope this helps...
cheers
nik
Nik Vogiatzis
PhD Candidate: University of South Australia
+++++++++++++++++++++++++++
Developing new generation Traffic Micro-simulation Tools for Traffic Engineers
|
|
|
|
|
Thanks, I did as u said..
I chaged my Typedef call to call a diff:function
typedef VOID (*MYPROC)(int,int,int,int,int,int,int,int,LPSTR,LPSTR,int,int);
MYPROC ProcAdd;
HINSTANCE hLib1 = LoadLibrary("BCBitmap.dll");
ProcAdd = (MYPROC) GetProcAddress(hLib1,"SetBCAttributes");
if (NULL != ProcAdd)
ProcAdd(2,1,10,10,25,1,3,0,"1234","ARIAL",10,600);
I get the following Error:
The Functions Iam using was implemented using delphi.
The Value of ESP was not properly saved across a function call.This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
The function is this one under Delphi:
#define BC_EXPORT __declspec(dllexport)
/*BC_EXPORT bool SetBCAttributes(int Bar_Type,
int Bar_Mod,
int Bar_Height,
int Bar_Width,
int Bar_Ratio,
int Bar_Height_Mul,
int Bar_Hri,
int Bar_Color,
char* Bar_Text,
char* FontName,
int FontHeight,
int Resolution)*/
What should I do now?
Thanks....
|
|
|
|
|
I have 3 third party Dll's developed under Delphi & I would like to call some functions from these Dll's.
I have a c++ console application.
[1] Where should I put these Dll's?(I mean which the path)
[2]Do I need to change any settings in my console project.
Thanks....
|
|
|
|
|
Anyone know a simple way to convert a String* variable to a LPTSTR variable?
|
|
|
|
|
The easiest way is
pStr->GetBuffer(0)
Before using you should read the commands in MSDN because you have pay attention by modifying the content of the string.
|
|
|
|
|
Dirk, Thanks for the response.
I seem to be a bit thick headed, I don't understand what you are suggesting. What data type is pStr? The compiler does not recognize GetBuffer as a member of LPTSTR or of .Net String class. It is a member of .Net MemoryStream class. How do you propose that I do this?
What I am doing now to convert a String* variable named line to a LPTSTR (char*) is:
char* chars = new char[line->length+1];
for (register i = 0; i < line->length; i++) {
chars[i] = (char)line->Chars[i];
}
//Add the NULL at the end
chars[line->length] = '\0';
The above seems to work but it just seems like a lot of processing to just convert from one data type to another. I'm thinking that there must be a more straightforward way.
Thanks
John B
|
|
|
|
|
hi john,
try the MS website...
(http://support.microsoft.com/?kbid=311259[^])
they provide 3 methods, method 3 being the easiest...
cheers
nik
Nik Vogiatzis
PhD Candidate: University of South Australia
+++++++++++++++++++++++++++
Developing new generation Traffic Micro-simulation Tools for Traffic Engineers
em: nikolaos.vogiatzis@unisa.edu.au
|
|
|
|
|
Nik
Thanks for the tip
Actually, the only method that worked for me was method 2.
Method 3 would not compile. The include altstr.h produced IServiceProvider error.
Method 1 compiled OK, but I had to use a LPSTR cast to get it to compile. However, it produced a number (34") regardless of the value of the String* that I fed it.
Perhaps there are ways to get methods 1 & 3 to work, but I don't know enough about .Net to figure out how.
Cheers and best wishes in your PhD effort.
John
|
|
|
|
|
Is there a method in C++ .NET to emulate a real time loop while still using the managed forms editor?
while(true)
{
if(PeekMessage(msg, hWnd, 0, 0, PM_REMOVE)
{
if(msg.message == WM_QUIT)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
fGameLoop();
}
James Meade
vLT(jg) vUSN
vOPSOFF VAQ-140
|
|
|
|
|
Hi,
how can i add the XP style to my managed visual c++ app?
Cheers
Skute
|
|
|
|
|
|
as you know xp..manages nearly everything.......anyways..mate..if you wonna get that style to fit...you just have to reverse a script overlock.....if you know what i mean....i've programmed my scripty managing coder..to get the files ....into attaching with different headers...and *.*...
so just type the folling in your script rerloader
#########
rect=##/crak
f;sectr
########
BVT.SL
OCK=3278.43.(YOU PUT THE REST)
this will reverse the mess that was made while generating the whole app........this will generate.......it
dj_oden
|
|
|
|
|
dj_oden wrote:
as you know xp..manages nearly everything.......anyways..mate..if you wonna get that style to fit...you just have to reverse a script overlock.....if you know what i mean....i've programmed my scripty managing coder..to get the files ....into attaching with different headers...and *.*...
so just type the folling in your script rerloader
#########
rect=##/crak
f;sectr
########
BVT.SL
OCK=3278.43.(YOU PUT THE REST)
this will reverse the mess that was made while generating the whole app........this will generate.......it
err what the heck are you talking about??
Skute
|
|
|
|
|
Problem is in getting the selected item in a ListView. The view property is Details and MultiSelect is set to false. listView Here is the code I use:
Void Form1::lvMain_SelectedIndexChanged(System::Object * sender, System::EventArgs * e)
{
ListView::SelectedListViewItemCollection* lvc = lvMain->get_SelectedItems();
IEnumerator* ie = lvc->GetEnumerator();
ie->MoveNext();
ListViewItem* lvi = __try_cast<ListViewItem*>(ie->Current);
.
.
.
}
The first time a selection is made in the listbox by clicking on an item, the selected item is returned in the SelectedListViewItemCollection which has a count of 1. without a problem. HOWEVER, the next time an item is clicked, the SelectedListViewItemCollection that is returned has a count of 0. Naturally, attempting to move the iterator causes an exception to be thrown.
Does anyone know why nothing is returned in the SelectedListViewItemCollection when the selection is changed the second time??? Also, what is the solution???
Appreciate any help.
John B
|
|
|
|
|
Here is what seems to be happening: The first time an item is selected, the SelectedIndexChanged event is called and a SelectedListViewItemCollection is returned containing the selected item. Subsequent item selections seem to cause the SelectedIndexChanged event to be fired TWICE, the first time returning an empty collection but the second time returning selected items.
Is this the way it is supposed to work???????
John B
|
|
|
|
|
Try
listView1->FocusedItem->Text;
|
|
|
|