|
sheetal_06 wrote: At that time it is trying to locate the function 'CPtrArray &CPtrArray::operator =(const CPtrArray &)'
There isn't one implemented. That's why it's an error.
sheetal_06 wrote: i am trying to pass a CSpanload object into a CCasObject
How are you passing it? Are you sure you need to do a full copy or could you pass a reference or
pointer? If you must copy then you'll need to copy the CPtrArray member appropriately. Since
it's an array of pointers - if the pointers are allocated using new and you copy the pointers
from one array to another, then delete the pointers in one array and try to delete the pointers
again in the copy array then it will crash.
|
|
|
|
|
Ya,I need to copy the pointer..
The pointers *pA3Ld and *pBDLd are created using new...
So could u plz suggest one solution...
When i am changing the code as follows it is working...But i din understand why?
class CSpanLoad : public CCASObject
{
public:
void operator=( const CSpanLoad & );//earlier it was const CCASObject &
private:
CPtrArray aPointArrays;
};
//spanload.cpp
void CSpanLoad::operator=( const CSpanLoad &src )//earlier it was const CCASObject &
{
//....
}
|
|
|
|
|
I am doing work in win32 console application. my problem is i want to hide the console window ,when my program is execute
pls help me .
thanks in advance
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Use FreeConsole(), hope it will work.
Smile
|
|
|
|
|
Use FreeConsole(),
I think while debugging it will not work. Try running in release mode, hope it will work.
Smile
|
|
|
|
|
Shilpi Boosar wrote: . my problem is i want to hide the console window ,when my program is execute
is it service or simple application???.. any way Don answer is correct...
"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
|
|
|
|
|
|
On >= Windows 2000 you can use code like this:
#include "stdafx.h"
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <iostream>
void HideConsoleWindow()
{
HWND hWnd = GetConsoleWindow();
if (hWnd)
{
ShowWindow(hWnd, SW_HIDE);
}
}
void ShowConsoleWindow()
{
HWND hWnd = GetConsoleWindow();
if (hWnd)
{
ShowWindow(hWnd, SW_SHOWNORMAL);
}
}
void main()
{
using namespace std;
cout << "Hello world..." << endl;
Sleep(1000);
HideConsoleWindow();
cout << "Text written while window hidden!" << endl;
Sleep(1000);
ShowConsoleWindow();
Sleep(1000);
}
Steve
|
|
|
|
|
Why not use win32 application without GUI?
|
|
|
|
|
For a console application, you still have the console window that is created. The OP wanted to hide this window.
|
|
|
|
|
You can create a Windows application, and then don't create a window. I think that's what he's proposing.
Software Zen: delete this;
|
|
|
|
|
I think I'm tired today, I read correctly what he said but I misunderstood it. Pff, time to have some rest
|
|
|
|
|
hi,
I have to get the filename as input and send it to a parser(already exists)
I cannot use CFileDialog because FlashPlayer is already having a dialog.
My task is to get the file input and sending it to the xml parser.
Thanks in advance
Siddhath
|
|
|
|
|
Asking the same question again will not get you the answers. Read the replies to your previous thread, I'm sure you will find the help you need there somewhere.
|
|
|
|
|
I think you asked like this question yesterday,right?
|
|
|
|
|
siddharthsan wrote: I have to get the filename...
What filename?
siddharthsan wrote: I cannot use CFileDialog because FlashPlayer is already having a dialog.
Since when are dialogs a limited resource?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
My application was binding to a specific address earlier, but now there is a requirement of binding it to INADDR_ANY, the problem which i'am facing while binding to INADDR_ANY is...the client can able to listen to the data coming from main IP of server i.e
for ex: my server system is having 7 IP's like 172.16.8.1 to 172.16.8.7, and main IP is 172.16.8.1...if client is connecting with 172.16.8.1 it works fine...but if it is connecting with other IP's, client is unable to listen to the data coming from other IPS.
Can any one suggest me a solution for this
mpk1979
|
|
|
|
|
If you bind to INADDR_ANY how will the other end know what address to send to?
|
|
|
|
|
Please consider this example:
#include <vector>
#include <list>
#include <algorithm>
using namespace std;
...
list <int> nums;
list <int> ::iterator nums_iter;
nums.push_back (3);
nums.push_back (7);
nums.push_front (10);
nums_iter = find(nums.begin(), nums.end(), 3);
if (nums_iter != nums.end())
{
cout << "Number " << (*nums_iter) << " found." << endl;
}
else
{
cout << "Number not found." << endl;
}
Here the elements are of type "int". So we can directly make a "find". But what if the pushed elements are objects? or struct variables?
for example:
typedef struct myStruct
{
int x;
int y;
}myStruct_t
myStruct_t mySObj; mySObj.x=10;mySObj.y=20;
list <myStruct_t> lst_mySObj;
list <myStruct_t>::iterator mySObj_iter;
How do I do the rest of the rest of the things?
Like this :???
mySObj_iter = find(lst_mySObj.begin(), lst_mySObj.end(),mySObj.x );
Not sure
*
|
|
|
|
|
Astricks wrote: typedef struct myStruct
{
int x;
int y;
}myStruct_t
In this case,class/struct should have operator == defined.
Which takes care of rest of the things.
Let me modify your code like this,
typedef struct myStruct
{
int x;
int y;
bool operator == (const myStruct rhs)
{
return ((x==rhs.x) && (y== rhs.y));
}
}myStruct_t ;
Now your code work with this structure.
|
|
|
|
|
Nice, it compiles now. Thanks. Now, the "find" doesn't work ! anyway thanks I've moved a step up.
list <myStruct_t> lst_mySObj;
for(int i=1;i<=20;i++)
{
myStruct_t mySObj;
mySObj.x =i;
mySObj.y=i;
}
myStruct_t mySObjFind;
mySObjFind.x =5;
mySObjFind.y=5;
list<myStruct_t>::iterator mySObj_iter;
;
;
mySObj_iter = find(lst_mySObj.begin(), lst_mySObj.end(),mySObjFind );
;
;
;
*
|
|
|
|
|
How have you defined the operator == on your struct?
|
|
|
|
|
Yes:
typedef struct myStruct
{
int x;
int y;
bool operator == (const myStruct rhs)
{
printf("\n%d,%d-%d,%d",rhs.x,rhs.y,x,y);
return ((x==rhs.x) && (y== rhs.y));
}
}myStruct_t;
*
|
|
|
|
|
It looks ok, but normally we would not pass a copy, try changin it to this
bool operator == (const myStruct& rhs) not that it should make a difference.
|
|
|
|
|
I changed it to reference type, but still doesn't work
I tried to print them :
for (mySObj_iter=lst_mySObj.begin(); mySObj_iter != lst_mySObj.end(); mySObj_iter++)
{
printf("\n%d",(*mySObj_iter).x);
}
Even this doesn't work
*
|
|
|
|