|
hi,
i am writing an application where i want to authenticate the password.
I wan that when user type his password , nothing should be echoed on the screen.
plz help me out
|
|
|
|
|
Did you intend this:-
when the user types something, the characters shouldn't appear?
If yes, then ES_PASSWORD style with the edit control is what you are after.
Vipin - MVP
|
|
|
|
|
hi friend ,
A small program for u.
if u try following program it will display strick when u type password and after passsword press Enter and u can see the password there ....... i think u got an idea to program about passsword if than plz mail so that i can understant that u got it ...
bye
Sudip Lama
//Program about the Password ///
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();char name[20];
cout<<"Enter the password"<
|
|
|
|
|
Hi my problem is that i have an VB.NET application and i call an opengl dll MFC application which creates a grafic window and i want when i click on the VB.NET window my opengl window being always on top and not to go in the background, does anyone have any idea?....
Thanks for ur time??
giotis
|
|
|
|
|
Try this
SetWindowPos(&this->wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
|
|
|
|
|
Thanks u for ur reply,i put it in the class where this window created,but it show me errors like there r few arguments and it can't recognize "this", one more question:how can i get the hwnd of my window? In msdn i look for the setwindowpos and and i realise that i need this...
if u have time please answer me.....!!!!
Thanks
giotis
|
|
|
|
|
I have recently installed fresh windows and curently i can't check if it is correct, but i think it is GetActiveWindows or FindWindow
|
|
|
|
|
Thanks one more time, maybe i m wrong but i create my opengl window with glutCreateWindow and everything was created with glut expresions, it creates an int type window and i can't convert it to HWND, is there any other way to make it topmost or to make an notopmost my vb.net window?...
giotis
|
|
|
|
|
Hello.
I thing the HWND is a LONG INT, but hwnd is used in c++ not in VB. "this" is a pointer used in C++ and in C#.
|
|
|
|
|
|
The code I gave you was MFC, and you need to convert that to the VB.NET equivalent. I don't know VB.NET so you'll have to ask a VB.NET guy to convert it for you.
|
|
|
|
|
In MFC(dll) i want to put that code because i want to call it from the VB.NET. Here is my code where i create my opengl window and all the values was given by the VB.NET. Any idea guys?
I try to find an expression in glut,glu libraries i didn't find anything!!
I want this window being in front of the VB form!!!!
void
create(int _posx,int _posy,int _sizex,int _sizey)
{posx=_posx; posy=_posy;sizex=_sizex;sizey=_sizey;
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE | GLUT_MULTISAMPLE);
glutInitWindowPosition(posx, posy);
glutInitWindowSize(sizex, sizey);
//SetWindowPos(hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
main_window = glutCreateWindow( "GLUI Example 5" );
CWnd::wndTopMost;
glui2 = GLUI_Master.create_glui_subwindow( main_window,
GLUI_SUBWINDOW_BOTTOM );
glui2->set_main_gfx_window( main_window );
GLUI_Rotation *cubform_rot = glui2->add_rotation( "CubiForm", CubiForm_rotate );
cubform_rot->set_spin( .98 );
glui2->add_column( false );
GLUI_Translation *trans_xy =
glui2->add_translation( "Objects XY", GLUI_TRANSLATION_XY, obj_pos );
trans_xy->set_speed( .005 );
glui2->add_column( false );
GLUI_Translation *trans_z =
glui2->add_translation( "Objects Z", GLUI_TRANSLATION_Z, &obj_pos[2] );
trans_z->set_speed( .05 );
glui2->add_column( false );
GLUI_Rollout *options = glui2->add_rollout( "Ortho", true );
glui2->add_checkbox_to_panel( options, "Draw Ortho", &show_ortho );
glui2->add_checkbox_to_panel( options, "Reset", &reset,0,(GLUI_Update_CB)mouse);
glui2->add_button( "Quit", 0,(GLUI_Update_CB)exit);
init();
}
giotis
|
|
|
|
|
I am writing a small applet which will read/write data in a binary file. BinaryReader/BinaryWriter is not quite compatible. I figured a mixed assembly of C++/CLI and native code would work perfectly and be educational as well. Unfortunately, all my attempts at doing this have failed. (I might add that if MS wants anyone to use C++/CLI, they need to make the IDE much more friendly to it.)
My preferred way of learning is by examining and stepping through working code. So, can anyone guide me to some a sample project doing something comparable that I can look at and step through?
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hello Joe
Why are the BinaryReader/BinaryWriter classes not suitable?
Also, why don't you just use CreateFile or one of the C or C++ file functions in your code?
|
|
|
|
|
Due to some low level data manipulation that needs to take place before the high level managed classes take over, indicatios are that I will get a huge performance boost by keeping that low level in unmanaged code.
As for CreateFile, that's what I intended to use in the unmanaged portion of the code. The problem is that for all the talk about C++/CLI, I have had a difficult time finding actual working mixed code I can use to learn this stuff. My only solution is to write straight C/C++ based native DLLs and P/Invoke into them from the .NET assemblies.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Just use your CreateFile calls and compile with /clr. I've done it before without problems.
|
|
|
|
|
You misunderstand. I have simplified the problem just to give some indication of what I was trying to do. It is absolutely essential that the core of the solution run natively. I want an assembly with a mix of managed and native classes. I want to find a working EXAMPLE on how to do this.
Thank you anyway for your help.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I did some googling and it's interesting to see that no one has written a publicly available demo that shows a DLL that exports native classes and ref classes. Interesting!
|
|
|
|
|
Btw, Joe. In your first post, you said "Unfortunately, all my attempts at doing this have failed."
If you could give some examples of how it failed, others might be able to give you suggestions on fixing them.
|
|
|
|
|
hi
i have to connect com2 to send,recive commands from a machine i have.
i success to send commands but not to listen to commands.
it run under linux(with c++).
the Parameters should be:
port :RS232
baud rate : 19200
data bits 8
parity none
stop bits 1
flow control none
the way i did it is :
fd = open("/dev/ttyS1", O_RDWR | O_NOCTTY | O_NONBLOCK);
if (fd == -1) //Could not open the port.
return false;
fcntl(fd, F_SETFL, FASYNC);
struct termios options;
//Get the current options for the port...
tcgetattr(fd, &options);
//Set the baud rates to 19200...
cfsetispeed(&options, B19200);
cfsetospeed(&options, B19200);
//Enable the receiver and set local mode...
options.c_cflag |= (CLOCAL | CREAD);
//Set the new options for the port...
options.c_cflag &= ~CSIZE; /* Mask the character size bits */
options.c_cflag |= CS8; /* Select 8 data bits */
options.c_cflag &= ~PARENB;
options.c_cflag &= ~CSTOPB;
options.c_cflag &= ~CRTSCTS;
options.c_lflag |= (ICANON | ECHO | ECHOE);
options.c_iflag &= ~(IXON | IXOFF | IXANY);
tcsetattr(fd, TCSANOW, &options);
and to write something like
write(fd, "abcdefg\r", 8);
and it works
but to read i tried and cant do it
what the problem?
may be i gave wrong flags to the parameters i need ?
how should i read data.
thanks.
|
|
|
|
|
This is the C++/CLI forum. You could try the Visual C++ forum, though since your question may be Linux-specific, even that might not be appropriate. In any case, this is not the right forum.
|
|
|
|
|
Hi,
I am using a vector of BSTR in one of the function
Fn()
{
vector <bstr> vbstrTest;
...
vbstrTest.push_back(bstrSomeBSTR)
}
Does the vector automatically cleans the BSTR string inside it? What is the best way to cleanup the vector, if it holds the custom\user defined types.
Thanks in advance,
Yash
|
|
|
|
|
Yash Purohit wrote: Does the vector automatically cleans the BSTR string inside it?
No. It won't.
Yash Purohit wrote: What is the best way to cleanup the vector, if it holds the custom\user defined types.
Use a CComBSTR instead of a BSTR? CComBSTR does its own cleanup in the destructor.
|
|
|
|
|
Hi, I am trying to perform a BitBlt operation, but I'm getting linking errors. Any help would be greatly appreciated.
I'm currently using Visual C++ 2005 Express, and I have a Windows Forms application. The Express version does not have MFC support. I've also installed the Platform SDK and followed the post-installation instructions as indicated on the page: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
I am trying to BitBlt an image from a device context (located within an unmanaged library) to the device context of a PictureBox control on the Form. Making calls to GetDC() and BitBlt() result in linking errors (the unresolved token/symbol types):
~~~~~~~~~~~~~
Linking...
MainWinMapView.obj : error LNK2028: unresolved token (0A0001E4) "extern "C" int __stdcall BitBlt(struct HDC__ *,int,int,int,int,struct HDC__ *,int,int,unsigned long)" (?BitBlt@@$$J236YGHPAUHDC__@@HHHH0HHK@Z) referenced in function "private: void __clrcall MainWinMapView::UpdateRefresh(void)" (?UpdateRefresh@MainWinMapView@@$$FA$AAMXXZ)
MainWinMapView.obj : error LNK2028: unresolved token (0A0001E5) "extern "C" struct HDC__ * __stdcall GetDC(struct HWND__ *)" (?GetDC@@$$J14YGPAUHDC__@@PAUHWND__@@@Z) referenced in function "private: void __clrcall MainWinMapView::UpdateRefresh(void)" (?UpdateRefresh@MainWinMapView@@$$FA$AAMXXZ)
MainWinMapView.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall BitBlt(struct HDC__ *,int,int,int,int,struct HDC__ *,int,int,unsigned long)" (?BitBlt@@$$J236YGHPAUHDC__@@HHHH0HHK@Z) referenced in function "private: void __clrcall MainWinMapView::UpdateRefresh(void)" (?UpdateRefresh@MainWinMapView@@$$FA$AAMXXZ)
MainWinMapView.obj : error LNK2019: unresolved external symbol "extern "C" struct HDC__ * __stdcall GetDC(struct HWND__ *)" (?GetDC@@$$J14YGPAUHDC__@@PAUHWND__@@@Z) referenced in function "private: void __clrcall MainWinMapView::UpdateRefresh(void)" (?UpdateRefresh@MainWinMapView@@$$FA$AAMXXZ)
D:\snapshot\dev_leeh_snapmmf_i4_RouteComparisonTool\snapmmf\utilityapps\RouteDiffer\Debug\RouteDiffer.exe : fatal error LNK1120: 4 unresolved externals
~~~~~~~~~~~~~
I've copied my code snippet below. The canvasSize and m_pOsCanvas variables have types which are part of my unmanaged library, but I don't that matters in the scope of this problem. m_MapPictureBox is a System::Windows::Forms::PictureBox control.
~~~~~~~~~~~~~
// Get the handle to the MapPictureBox
HWND hScreenWnd = (HWND) m_MapCtrlCollection->m_MapPictureBox->Handle.ToPointer();
// Get the device context of the screen
HDC hScreenDC = GetDC(hScreenWnd);
// BitBlt the image to the device context
BitBlt(hScreenDC, 0, 0, canvasSize.getWidth(), canvasSize.getHeight(), m_pOsCanvas->getDeviceContext(), 0, 0, SRCCOPY);
~~~~~~~~~~~~~
I'm guessing the problem is some sort of setting that I am unaware of. I am assuming that I can make GDI calls in the Express edition.
If you what's going on, please provide help.
Thanx,
Lee H.
-- modified at 17:38 Friday 16th December, 2005
|
|
|
|
|
You need to input the required lib files to the linker - such as Gdi32.lib, user32.lib etc.
|
|
|
|
|