|
Astricks wrote: So the panic.
No Problem. I followed your link only after my post, to see that you are actually caring for the answers. Therefore I was pointing you to the documentation before answerinf your question.
But really, the Josuttis helps greatly when working with the STL.
And the Myers is great in giving lectures about dos and donts with the STL.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I voted you up, but it greyed
*
|
|
|
|
|
I dont know why you get low vote I give 5 to you
|
|
|
|
|
Someone does not share my taste in books?
Anyway - thanks!
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Sometimes I going to meet of new ideas on your mail you answer and suggest a book to him its worth
|
|
|
|
|
or maybe just the way you suggested it, implying that the OP didn't search first.
i personnaly found the tone of your post a bit aggressive, so i can understand someone else did too...
|
|
|
|
|
have you tried using this :
lst_mySObj.erase(mySObj_iter);
if i remember well, erase() gets an iterator, not an element of the vector
also, if you're cleaning the whole vector, use clear() instead
|
|
|
|
|
Thanks toxcct
*
|
|
|
|
|
hi..
I hve design .net based C++ class library. I want to use it in vb.net proj.
My class library code compile without an error. But when i access that library in vb.net proj it gives me an error (its run time error)
error discription:
Unhandled Exception: System.BadImageFormatException: Could not load file or asse
mbly 'Appa, Version=1.0.2598.12775, Culture=neutral, PublicKeyToken=null' or one
of its dependencies. An attempt was made to load a program with an incorrect fo
rmat.
File name: 'Appa, Version=1.0.2598.12775, Culture=neutral, PublicKeyToken=null'
at Anna.MyModule.Main()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\M
icrosoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure lo
gging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fus
ion!EnableLog].
===========================================================
// Appa.h
#pragma once
using namespace System;
namespace Appa
{
public ref class MyClass
{
public:
int Add(int x, int y);
};
}
===========================================================
// This is the main DLL file.
#include "stdafx.h"
#include "Appa.h"
namespace Appa
{
int MyClass :: Add(int x, int y)
{
int k = x+y;
return k;
}
}
=================================================
//MyModule.vb
Module MyModule
Sub Main()
Dim obj As New Appa.MyClass
Console.WriteLine(obj.Add(10, 15))
End Sub
End Module
=================================================
plz help me guys
|
|
|
|
|
Where is your DllMain function ? And how did you create your dll project ?
|
|
|
|
|
// This is the main DLL file.
#include "stdafx.h"
#include "Appa.h"
namespace Appa
{
int MyClass :: Add(int x, int y)
{
int k = x+y;
return k;
}
}
and abt dll in vs2005
just select new project
visual c++
CLR --> class library
in this way... and i also add referece of this proj in vb.net proj.
MyClass is my classs
and add is my main dll fuction
|
|
|
|
|
dalbhide bipin wrote: CLR --> class library
Isn't CLR managed C++ (I know nothing about managed C++ so I'm not sure). If yes, you'd better ask this forum[^]
|
|
|
|
|
Hi all,
I'm writing a program using VC++ 6.0. The program is send and receives messages - string - via serial port. I used Overlapped mode for the communication. The program does not know when the data will come. i.e. if there is a data coming from the serial port at any time, read it. I used MFC in this project, so where is the best place for ReadFile() so that it checks if there is any data coming from serial port?? Thanks in advance
What I learned is still a dot in the programming world
|
|
|
|
|
I also have the same problem to read the file from the serial port.
Regards,
Ram
|
|
|
|
|
Have a look at Joe Newcomer's article about a threaded solution to serial programming: clickety[^].
In the article Joe uses UI threads. I've developed my own with worker threads.
In addition to Joe's article you have to use ::SetCommState() in order to set baudrate and such. You should also set the timeouts for the read and write operations with ::SetCommTimeouts() . I usually set ReadIntervalTimeout and ReadTotalTimeoutMultiplier to MAXDWORD to get a special behaviour where a read operation expires after ReadTotalTimeoutConstant ms even if nothing has been received. In my opinion a reasonable value for ReadTotalTimeoutConstant would be 50 ms.
Read more here:
::SetCommState()[^]
::SetCommTimeouts()[^]
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Thanks Roger Stoltz for help
I found a function that called all the time. I put the ReadFile() there. The function is DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam).
Right click on the dialog>Classwizard
from Messages Maps tab choose DefWindowProc under Messages. Add function then edit code .
|
|
|
|
|
|
How do I display the text in the status bar pane as right justified?
If I use the following code,
CDC* pDC = m_wndStatusBar.GetDC();
pDC->SetTextAlign(TA_RIGHT);
It's not working.
|
|
|
|
|
if you are manullay drawing in the status bar you can use DrawText() with style DT_RIGHT
nave
|
|
|
|
|
No.I am displaying the text in the status bar that was entered from a edit box in a dialog. The code for displaying the message is,
void CPerspectiveDoc::OnShowMsg(CCmdUI* pCmdUI)
{
char str1[150];
//int len = message.GetLength();
sprintf(str1, "%s",message.GetString());
CDC* pDC = m_wndStatusBar.GetDC();
pDC->SetTextAlign(TA_RIGHT);
pCmdUI->Enable(TRUE);
//m_wndStatusBar.SetPaneInfo(1,IDS_MESSAGE,SBPS_NORMAL,100);
pCmdUI->SetText((const char *)str1);
//m_wndStatusBar.SetPaneInfo(1, IDS_MESSAGE, SBPS_STRETCH, len);
}
ID for that edit box is, IDS_MESSAGE.
|
|
|
|
|
T.RATHA KRISHNAN wrote: pDC->SetTextAlign(TA_RIGHT);
This will not do.
I think you should owner draw the status bar.
nave
|
|
|
|
|
Why you dont use of manullay drawing ?
|
|
|
|
|
Hi
I would like to create a Login Screen that would mimic the Windows XP Welcome Screen. Typically my app would handle many users on a single machine. Therefore the Login screen should show several usernames with edit boxes for their passwords. When a user needs to login, she should be able to navigate through the list of usernames in the Screen just like in the Win XP Welcome Screen and select the required username and enter the password.
My que is, how do I animate the controls to mimic the Windows XP Welcome Screen and also what controls should I use ( CWnd / CDialog ) to best achieve this ?
thanx , expecting a quick reply.
Eraj.
|
|
|
|
|
There is nothing special about the welcome screen. It is just a full screen window with a few skinned controls.
In your case, it may be better to use a CDialog, that way you can run and destroy it before you main window appears. Look on CP for articles about skinning controls. If you want it to be fullscreen, make the dialog topmost, remove all borders, and adjust the size so that it fills the screen.
|
|
|
|
|
No no, my question is not regarding the Welcome Screen itself.
But rather the control with the Username and Password field together, which lightens up when not focused, and darkens when in focus.
In other words, Im only worried about creating the control for showing the Username and the Password field for each user, that would have a similar look and feel to that of the XP login. I jus want to animate the controls that way.
I would hold all these individual Username/Password combo controls in a CDialog.
Its jus the animation of the controls Im really worried about and have no clue of !
|
|
|
|