|
May I ask you why do you want to do this wonderful conversion? Did you get an error like "Unable to convert parameter 3 from int to unsigned short* ? If so, what exactly were you trying to do?
"The difficulty lies, not in the new ideas, but in escaping from the old ones."
-- John Maynard Keyes, 1936
|
|
|
|
|
I want to use U16,U8 in my functions...
|
|
|
|
|
hi,
plz help me out.
how i can get an thread ID/ process ID for an exe.
for eg, i want to hold a thread which is executing copying operation (i.e, explorer.exe).
Thread ID more preferable if not ,atleast Process ID using vc++.
thanking u,
ram
|
|
|
|
|
|
I am using an application called Somnologica that has with at a SDK for writing plugins. It is provided as a static library compiled with VC 6 and header files. It uses MFC 6 extensively in the interfaces.
Currently I need to use Visual C++ 6 to compile these plugins but I am getting very tired of using a 9 year old compiler. I would much rather be using Visual C++ 8 ( even 7.1 would be a huge improvement ).
Any ideas on how I might go about this?
One strategy I have considered is using VC++ 8 but compiling the plugin using VC 6's header files and MFC but this seems like it would fraught with difficulties. And even if I get it to compile with MFC 6, I've got no idea what binary compatibility problem I might encounter.
Thanks
|
|
|
|
|
Release-mode LIBs are (or should be) forward-compatible with future linkers. Debug-mode binaries are never guaranteed to be compatible, though.
|
|
|
|
|
I´m starting a new mission critical (lots of transactions per second) tcp based nt service.
I don't want to program the tcp client\server stuff from scratch, so do you have any good tips on a professional winsock library ? It may be free or not, quality and usability are on target.
Thanks for any help !
|
|
|
|
|
|
GuimaSun wrote: ´m starting a new mission critical (lots of transactions per second) tcp based nt service.
I don't want to program the tcp client\server stuff from scratch, so do you have any good tips on a professional winsock library ? It may be free or not, quality and usability are on target.
Thanks for any help !
http://www.codeproject.com/internet/#Client%2FServer+Development[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
When i use the following code all works well for a while. If you enter the inner loop once it works fine but will not allow to enter it a second time. can someone explain this to me please or show me how to enter it again.
thanks.
<br />
#include <iostream><br />
<br />
using namespace std;<br />
<br />
int main () {<br />
int number;<br />
int testval = 0;<br />
<br />
while (true) {<br />
cout << "Pick a number 4 quits" << endl;<br />
cin >> number;<br />
if (number == 4) {<br />
return 0;<br />
}<br />
else if (number == 1) {<br />
while (testval != 5) {<br />
cout << "pick a new number: ";<br />
cin >> testval;<br />
<br />
if (testval == 1) {<br />
cout << "inner loop 1" << endl;<br />
}<br />
else if (testval == 2) {<br />
cout << "inner loop 2" << endl;<br />
}<br />
else {<br />
cout << "inner loop 3" << endl;<br />
}<br />
}<br />
}<br />
else if (number == 2) {<br />
cout << "outer loop 1" << endl;<br />
}<br />
else {<br />
cout << "outer loop 2" << endl;<br />
}<br />
}<br />
}<br />
|
|
|
|
|
Can you wrap your code in pre tags instead of code tags?
Unindented code is hard to read (for me anyway )
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
sure thing
#include <iostream>
using namespace std;
int main () {
int number;
int testval = 0;
while (true) {
cout << "Pick a number 4 quits" << endl;
cin >> number;
if (number == 4) {
return 0;
}
else if (number == 1) {
while (testval != 5) {
cout << "pick a new number: ";
cin >> testval;
if (testval == 1) {
cout << "inner loop 1" << endl;
}
else if (testval == 2) {
cout << "inner loop 2" << endl;
}
else {
cout << "inner loop 3" << endl;
}
}
}
else if (number == 2) {
cout << "outer loop 1" << endl;
}
else {
cout << "outer loop 2" << endl;
}
}
}
|
|
|
|
|
Once testval has been set to five in the inner loop then the inner loop will never be
entered again because testval is still 5.
Try this:
int main ()
{
int number;
int testval = 0;
while (true)
{
cout << "Pick a number 4 quits" << endl;
cin >> number;
if (number == 4)
{
return 0;
}
else if (number == 1)
{
while (testval != 5)
{
cout << "pick a new number: ";
cin >> testval;
if (testval == 1)
{
cout << "inner loop 1" << endl;
}
else if (testval == 2)
{
cout << "inner loop 2" << endl;
}
else
{
cout << "inner loop 3" << endl;
}
}
<code>testval = 0;</code>
}
else if (number == 2)
{
cout << "outer loop 1" << endl;
}
else
{
cout << "outer loop 2" << endl;
}
}
}
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
ahhh i'm silly sometimes.
thank you much for that i was going nuts truing to figure it out.
|
|
|
|
|
You just completed a homework assignment for him...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I use CPropertySheet create property sheet dialog.
I found that they has four button inside are OK, CANCEL, Apply and HELP.
How I disable or remove HELP button from property sheet dialog?
|
|
|
|
|
In the propertysheet constructor you put the following
m_psh.dwFlags &= ~(PSH_HASHELP);
and in each of the propertypage constructors put
m_psp.dwFlags &= ~PSP_HASHELP;
Then the help and apply buttons will be removed.
|
|
|
|
|
Tony Hill wrote: and in each of the propertypage constructors put
m_psp.dwFlags &= ~PSP_HASHELP;
This step will not be required here(in property page c'tor). As this flag deals with enabling/disabling help button, if it is there.
Prasad
MS MVP - VC++
|
|
|
|
|
hello,
here is sample code:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner){
}
//---------------------------------------------------------------------------
int* Instructions(int nr, int dydis, int &index){
int* instr=new int[dydis];
for(int i=0; i<dydis; i++)
instr[i]="i;
index=dydis;
return" instr;
}
="" ---------------------------------------------------------------------------
void="" __fastcall="" tform1::button1click(tobject="" *sender){
int="" *instrarr,="" size,="" index="0," i;
size="StrToInt(Edit1-">Text);
for(i=0; i<size; i++){
instrarr="Instructions(i," size,="" index);
}
for(i="0;" i<index;="" i++){
instrarr[i]="InstrArr[i]*InstrArr[i];
Memo1-">Lines->Add(IntToStr(InstrArr[i]));
}
delete[] InstrArr;
}
//---------------------------------------------------------------------------
i found out that :
for(i=0; i<size; i++){
instrarr="Instructions(i," size,="" index);
}
is="" working="" some="" how="" not="" correctly.="" could="" i="" make="" it="" to="" work="" properly?
=""
<div="" class="ForumSig">Dj_Lord
|
|
|
|
|
the code was printed somehow strangely..
here is the link for full code:
http://www.paste.lt/paste/508075a01ab2229c852d831278379bab
wrong lines: 28-30.
Dj_Lord
|
|
|
|
|
Dj_Lordas wrote: is working some how not correctly.
How so? What is "work properly"?
Every time through the loop you overwrite the previous InstrArr value.
All those arrays never get deleted.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
True and beyond that the code makes no since to me.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
John R. Shaw wrote: and beyond that the code makes no since to me.
I'm right there with ya on that one
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
i am very beginner in c++, could you show, how to correctly delete these arrays? could you write how the good code looks like?
Dj_Lord
|
|
|
|