|
thanks for ur reply.
i have to send/receive sms(short message service) in my application from my pocket pc phone by programmetically...(using mfc).
i am using windows mobile6.0.
thanks.
paulraj
|
|
|
|
|
|
I have a vector of millions of points that I have to sort based on their distance from the camera, in order to do that i created the following simple function object:
class PointSorter
{
public:
PointSorter()
{
points = NULL;
}
PointSorter(const PointSorter& other)
{
points = other.points;
printf("object copied");
}
PointSorter(std::vector<vl::fvec3 xmlns:vl="#unknown">* pvec==NULL)
{
points = pvec;
}
bool operator()(const unsigned int&a, const unsigned int&b)
{
return (*points)[a].z() < (*points)[b].z();
}
std::vector<vl::fvec3>* points;
};
</vl::fvec3></vl::fvec3>
then later on I do a simple
PointSorter sorter(&mypoints);
std::sort( indices.begin(), indices.end(), sorter );
</int>
this sorts the indices of my points well, the only concern is that I discovered that the object "sorter" is being copied all the time during std::sort, this shurely impact negatively the sorting performance which is already quite poor for millions of points since I have to achieve interactive frame rates for my 3d program.
Does anyone know how to pass a custom sorter object (which is not a static function) that is copied once and used all the way throughout the sorting?
Regards,
Michele
|
|
|
|
|
what about you change the code of std::sort make it use the 3th parameters pass by reference?
|
|
|
|
|
hi all,
i have one issue about how to get the boot volume drive letter in the vista and win2k8,
i need to got this letter and verify if the system info is in safe states.
i knew if i use the WMI can fix this, but the WMI take lots of time
thanks for your help
DraculaW
|
|
|
|
|
Hi all,
I m using CDateTimeCtrl.
i m try this::
CDateTimCtrl m_time;
m_time.SetFormat(" ");//in OnInitDialog();
but its not working.
how can i show blank CDateTimeCtrl?
please help me for this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
See here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks sir its done.
but now tabstop is not working here and this control not get focus.
please help me for this.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hello,
I am currently writing an application that is started by another process using the OpenProcess function. After this application is done, it calls TerminateProcess, which instantly closes my application.
Before my application exits, I still have to do some things, so my first question is: how can I handle the TerminateProcess call in my application, do I get a message? How do I know insinde my application that TerminateProcess has been called?
The second one: is there a better way to exit my application automatically than calling TerminateProcess?
|
|
|
|
|
Send WM_CLOSE Message to ur window
Get Handle of window with FindWindow
And Handle OnClose in Your application.
|
|
|
|
|
To expand on the other answer you got ... If your app does not have a message queue (i.e. it cannot receive a WM_CLOSE), you'll need to use some sort of signaling mechanism like a named event that can be accessed across process boundaries. You've discovered why TerminateProcess should be avoided at all costs - it leaves things in a very messy state.
Judy
|
|
|
|
|
Hey dudes! I am using VS 2005 and doing work in Visual C++ windows Applications. I am facing a prob that i have a class in which my data members are char * but when i get data from text box or edit box it is in the form of String. But i have to convert it into char*. How can i do it??
I got how to convert char * to string by COnvert::ToString(char*).
And other one problem is that when i add a class, when i add data member as String or String^ it didn't allow me. To do it which header file Should i include??
|
|
|
|
|
To convert String to char*, use the function c_str(). This function will return a const pointer to a regular C string(which will be identical to the passed in string).
std::string Test1 = "Text to Test";
char *Test = Test1.c_str();
Regards,
Rane
|
|
|
|
|
as per my knowledge System::String doesn't have c_str() function , though std::string generally have.. also it return const char*
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Hi,
You cant use c_str() in CString.
You have to use this function to convert a CString to a char *
char* ConvertToChar(const CString &s)
{
int nSize = s.GetLength();
char *pAnsiString = new char[nSize+1];
memset(pAnsiString,0,nSize+1);
wcstombs(pAnsiString, s, nSize+1);
return pAnsiString;
}
All the best...
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
if you are using CString there is a method called GetBuffer()
CString s;
char *ch = s.GetBuffer(s.GetLength())
May be it will solve your problem.
plz feedback if you solve it.
|
|
|
|
|
onlyjaypatel wrote: if you are using CString there is a method called GetBuffer()
What ? GetBuffer is the worst thing you can call to do that. CString provides an operator to do the casting, so if it doesn't work, GetBuffer won't work neither. Also, if you do not call ReleaseBuffer later, your CString object can be corrupted. Please, read this[^].
|
|
|
|
|
Which kind of string are you talking about ? CString (from the MFC) or std::string (from the STL) ? You probably have UNICODE define, that's probably why you can't 'convert'. I highly suggest that you read this excellent article[^], things will be much clearer afterwards.
Shirani wrote: when i add data member as String or String^
Are you using managed C++ ? If yes, then this is the wrong forum. This forum is for C++ only, not managed.
|
|
|
|
|
Cedric Moonen wrote:
Are you using managed C++ ? If yes, then this is the wrong forum. This forum is for C++ only, not managed.
atleast somebody have sharp common sense here [ ]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
this is managed c++ related query and it should be asked in it particular section!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
I am looking for code for an interpolation of x,y pairs
y=f(x), linear, polynomial, spline all O.K.
Thanks
|
|
|
|
|
mrby123 wrote: I am looking for code for an interpolation of x,y pairs
y=f(x), linear, polynomial, spline all O.K.
Please try googling first, also as per my knowledge interpolation formula is easy to implements (some , not all ) .. try it
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
In the MSDN, CToolBarCtrl help file is below.
To use a CToolBarCtrl object, you will typically follow these steps:
1. Construct the CToolBarCtrl object.
2. Call Create to create the Windows toolbar common control and attach it to the CToolBarCtrl object. Indicate the style of toolbar by using styles, such as TBSTYLE_TRANSPARENT for a transparent toolbar or TBSTYLE_DROPDOWN for a toolbar that supports drop-down style buttons.
3. Identify how you want the buttons on the toolbar displayed:
(1)•To use bitmap images for buttons, add the button bitmaps to the toolbar by calling AddBitmap.
(2)•To use images displayed from an image list for buttons, specify the image list by calling SetImageList, SetHotImageList, or SetDisabledImageList.
(3)•To use string labels for buttons, add the strings to the toolbar by calling AddString and/or AddStrings.
I don't understand step 3, (1),(2),(3) I could use either one of it(like only use (2)only), or I can use (2) and (3) together.
Sorry for not fully understanding to read the MSDN.
|
|
|
|
|
I have a multithreaded app that has been successfully using CAsyncSockets to talk to non windows sockets for some time. I have also created CAsyncSockets in their own threads to talk to other instances of this app and it worked fine years ago under Windows 98.
Trying to run it now under XP it stops receiving OnReceive callbacks after an indeterminate time - sometimes just one or two seconds, sometimes a couple of minutes or so. When the callbacks stop, other network apps on the machine also fail (i.e. Internet Explorer, Ping, Net Browser, Shared drives etc all stop working ) until I exit the app.
I have checked the network with WireShark, and the packets are still coming in as expected, just OnReceive is not called. Calls to close socket still work, and reconnecting restarts it again for a short while.
I have slowed the transmission of the packets down to just one 20byte packet per second - it still locks up.
I have called GetSockOpt(SO_ERROR..... No indication of any error.
I have even replaced CAsyncSocket with CAsyncSocketEX from elsewhere on this site and I get exactly the same results.
I am, of course, using a UI thread not a worker thread so a message pump gerts to handle the messages properly.
I have tried it on many different systems all give same problem.
Anybody got any suggestions??
|
|
|
|
|
I have managed to move this forward a little in that the application works well under Windows NT4.0.
Problem is now clearly a windows XP platform problem. With my server application running on Windows XP, and the Client on Windows NT4.0 it all works as expected.
With the client (same .exe file) running on Windows XP arrival of the ethernet packets fail to call the OnReceive function after somewhere betweeen one second and a couple of minutes. When this happens, all other Ethernet comms on the system lock up until the socket in the client is closed.
This must be an XP (tcp stack) problem?
Where do I go for help????
|
|
|
|