|
So you have first hand experience of this problem since you used VC++ 6 ?
Let's continue this discussion on YAHOO! Messenger shall we ?
I'm going to email you
|
|
|
|
|
sorry i dont have yahoo here...
but one thing I hate with the VC++ wizard creating the property page is that, all the pages are created in the same file. So often i create only one page using the wizard and add all other pages manually. Also i dont know why they kept a limit of 9 in the wizard.
nave
|
|
|
|
|
So in order for me to try what you suggest I have to use the Classwizar to add a derived class and EVRYTHING that the Wizard wizard creates for me will be created (Messagemaps and all) ?
What so you say...
Can you send me a small such demo app (a few snippets to help me out will do)
And can I get back to you in the next 2 hours (because I will be trying your method during this time)
Please tell me...
|
|
|
|
|
Hi all,
I wish to develop a VC++ 6.0 project to send SMS from PC to mobile. Since i am very very new to this PC to mobile communication development.
Can anyone plz show me a pathway to follow to reach my goal?
Thanks in Advance.
Regards,
Ram
|
|
|
|
|
|
Thanks a lot for your valuable information.
Regards,
Ram
|
|
|
|
|
Hey all,
Iam using VC++6.0.
I am trying to copy the packet data receeived from the serial device in to a ciruclar buffer. But when I try to copy the packet contents from the circular buffer to another local buffer, I am succesful in my first copy. But if a second packet comes into PC, I still keep copying the first packet only. I track the buffer count using a pointer.
I dont understand whats wrong.
Heres the code snippet.
void CMainFrame::OnPortRx(WPARAM wBytesRx, LPARAM lE)
{
char* cpRxData = new char[wBytesRx];
memcpy(cpRxData, m_commPort.GetRawInput(), wBytesRx);
}
where GetRawInput is :
char* CComm::GetRawInput()
{
return m_commInfo->cCircularBuffer;
}
here, CComm is the communciation class
Say, I receive 10 bytes in first packet.
I update the circular buffer count in the Readbuffer() function , I read the second packet having 10 bytes and copy thenm in to circular buffer index being 10 to 19. On every newpacket the buffer index is kept track of and copied. But when I use GetRawInput to do memcpy, the cicular buffer contents from 0 to 9 gets copied in to cpRxdata everytime.
Any help please?
|
|
|
|
|
thathvamsi wrote: memcpy(cpRxData, m_commPort.GetRawInput(), wBytesRx);
Above statement copies the first "wBytesRx" number of bytes to the cpRxData from the start for the cCircularBuffer. And that is always the first packet you received, as you are appending the cCircularBuffer as you receive new packets.
There are multiple ways to solve this depending on your requirement, like whether you need to keep the old packet data in the cCircularBuffer or can discard them or whether the packet length is always same or can vary.
Keep track of your packet numbers and return the char pointer (when you return it in the GetRawInput()) starting from the packet you are trying to access in OnPortRx.
Ankita
|
|
|
|
|
Hi everyone, please help me to convert integer type values to character type values.
"You have to be in a situation where you see just how fast things fail to make you take it seriously, I guess. " Bruce Eckel
|
|
|
|
|
are you serious?
let's see, method 1:
CString sText;
int nValue = 9901;
sText.Format("%d", nValue);
If CString is not your style, you can always sprintf. itoa will also get the job done.
Charlie Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
My son's PDA is an M249 SAW.
|
|
|
|
|
Thanks bro, i'm really serious :->... my friend actually ask me that a while ago. I'm digging in directx programming so i don't have time to recall. It's great coz i've learned itoa. Thanks..
"You have to be in a situation where you see just how fast things fail to make you take it seriously, I guess. " Bruce Eckel
|
|
|
|
|
Kuroro Rucilful wrote: hanks bro, i'm really serious :->... my friend actually ask me that a while ago. I'm digging in directx programming so i don't have time to recall. It's great coz i've learned itoa. Thanks..
if Looking for Runtime Function then you can try _ttoi or _itot function
"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
|
|
|
|
|
don't you know that char is also an integral type ?
you can simply do this :
int i = 2;
char c = i;
but maybe what you meant wasn't that but "converstion from int to C-Style strings" !?
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
See maybe it is some helpful to you
<code>
CString str;
TCHAR lpc[20];
TCHAR Buffer[20];
lpc[0]='\0';
(1) str.Format("%d",123);
(2) wsprintf(lpc,"%d",456);
(3) itoa(789,Buffer,10);
whitesky
|
|
|
|
|
I make a win32 program which use createthread function,the code:
header file "vfw_receiver_July_18Dlg.h"
DWORD WINAPI sock_thread( LPVOID pParam );
the header file <windows.h> is already included.
source file "vfw_receiver_July_18Dlg.cpp"
DWORD WINAPI CVfw_receiver_July_18Dlg::sock_thread(LPVOID pParam)
{
...
}
void CVfw_receiver_July_18Dlg::OnButtonStare()
{
...
DWORD Dummy;
HANDLE h=CreateThread(NULL,NULL,sock_thread,NULL,NULL,&Dummy);
}
When I compiled the source file, it throws a error says :"
error C2664: 'CreateThread' : cannot convert parameter 3 from 'unsigned long (void *)' to 'unsigned long (__stdcall *)(void *)'
anything wrong with my code? please give me some advice , thanks in advance.
|
|
|
|
|
The CreateThread takes a pointer to a global (non-member or static member) function, not a pointer to a member function.
You'll have to do something like this:
class CVfw_receiver_July_18Dlg : ...
{
void OnButtonStare()
{
DWORD dwThreadId;
HANDLE h = CreateThread(
NULL,
0,
&CVfw_receiver_July_18Dlg::RawThreadProc,
this,
0,
&dwThreadId
);
if (h)
{
CloseHandle(h);
}
}
DWORD ThreadProc()
{
}
static DWORD WINAPI RawThreadProc(LPVOID lpParameter)
{
CVfw_receiver_July_18Dlg *pThis = static_cast<CVfw_receiver_July_18Dlg *>(lpParameter);
return pThis->ThreadProc();
}
};
Steve
PS: Unless you know what you're doing you shoudn't use CreateThread . Use beginthread or beginthreadex instead.
|
|
|
|
|
Stephen Hewitt wrote: PS: Unless you know what you're doing you shoudn't use CreateThread. Use beginthread or beginthreadex instead.
That's a great way to state that. Of course as soon as someone a:-Dsks why the fun begins.
Also not a great idea to send a UI based class as the LPARAM to a Thread Proc unless you know what you are doing. I would even argue that it is not a good design even if you do know what you are doing.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
led mike wrote: Also not a great idea to send a UI based class as the LPARAM to a Thread Proc
Passing a pointer to the class in question in the LPARAM is a common technique to get a member function to run in another thread - It's standard practice. I would argue that multi-threading is not a good idea at all unless you know what you're doing however.
Steve
|
|
|
|
|
Sure... which is why a UI class event handler method should not be starting a thread, from a design standpoint.
Stephen Hewitt wrote: I would argue that multi-threading is not a good idea at all unless you know what you're doing however.
Spot on!
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Thanks to Steve and Mike very much. I have settled it out according to your help.
Regards!
Robert
|
|
|
|
|
Sir,
Do you know something about usbzip32 or usbzip63 boot?
Such as mainboard setting and the file system(Fat16/Fat32) of my usb mass storage device?
Does the disksize of usbzip32 boot device must less than 2GByte?
And i like to discuss this topic with you by msn;player_game04@hotmail.com
Thanks a lot!
momer
All the blesses we enjoy are the fruits of labor,toil,study and self-denail.
All the blesses we enjoy are the fruits of labor,toil,study and self-denail.
|
|
|
|
|
I downloaded the latest copy and ran the vcvars32.bat. Then I ran nmake to build the boost libraries. All worked fine. Next I tried a simple test app to experiment with boost regex. The app will not complie and there is an error message: 'BOOST_REGEX_VC6_MDID.DLL' missing.
In the settings for C++ -> Reprocessor I added the path to "Additional Library Paths" I also set the library path for the Link -> Input setting.
How can I tell if the VS6 environment paths are set correctly and that the proper include and lib paths are set?
Mark
|
|
|
|
|
Have you built Boost. Most of Boost is simple header files and doesn't need building but the more complicated libraries such as Boost.Regex need to be built. You will have to mess around with "bjam".
Steve
|
|
|
|
|
I followed the instructions in this article:
Adding Regular Expressions to Your App with Regex++
I believe that the RegEx download from Dr. John Maddock's site has already been built using bjam.
When I tried compiling the demo app that the CP article lists the system returns the missing DLL error message.
Mark
|
|
|
|
|
Mark F. wrote: I believe that the RegEx download from Dr. John Maddock's site has already been built using bjam.
My comments were on Boost; I'm not sure what the deal is if you download RegEx separately. Still though, Regex uses STL and is packaged in .lib files (part of it anwyay). It uses the STL that your compiler uses. Given that the C++ ODR (One Definition Rule) states that all definitions of a class must be consistent in all compilation units this implies that you'll have to build RegEx using your compiler's libraries to ensure this consistency. Perhaps it has already been pre-built for a number of popular compilers, but I doubt it. Also if you've modified your STL, by installing the Dinkum VC6 STL fixes for example, you'll have to rebuild it.
Steve
|
|
|
|