|
I don't know. But you may test the dialog outside of the browser to see if it's a problem that only occurs inside the browser or not.
You may also try explicitly setting the password char and see if that helps or not in your case.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
yeah, i've seen this too, but once the page is completely loaded, the asterisks are well displayed...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Folks here is another one,
I do all operations on bitmaps within .NET DLL project, while the DLL is being used by a C++ project(windows project to be exact). When I perform operations on bitmaps I have to pass locations of them from C++ project to .DLL.
BSTR bla(L"C:\\temp\\TestDLL1.bmp_BGL.bmp");
BSTR bla1(L"C:\\temp\\TestDLL1.bmp_GDI.bmp");
HRESULT hr = myobject->Load2BitmapsfromFile(bla, bla1, 50, &m);
Vb.NET DLL project is set to recieve these path locations as parameters and based on them create bitmaps and more.
The problem raises when I run my C++ project and debug to realize that the strings used to pass bitmap locations to .DLL are now empty. Thus I got nothing useful from that method in DLL.
Any commnets on this would be helpful.
Thank you,
Sincerely,
Max Pastchenko
|
|
|
|
|
mpastchenko wrote:
Vb.NET DLL project
Why are you being so cruel to C++, to make it talk to VB ? :P
Seriously though, what's the reason for this ? You can write GDI+ code in C++, you don't need .NET at all.
mpastchenko wrote:
The problem raises when I run my C++ project and debug to realize that the strings used to pass bitmap locations to .DLL are now empty.
The strings are constants and they are empty ? Or are you not looking at them properly ? Can the IDE show the contents of a BSTR ? If they are constants, they simply cannot be empty, as far as I can see. Why not debug the dll and see what ends up in VB.NET ? Or just put in a log file or something.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
In instead of having next programmer, work with GDI+ and put that constraint on him (this is a only a part of the project that will be used by someone else), I would rather contain all GDI+ in .NET thats why I am using paths (strings). So its easier for someone else, especially if not familiar with GDI+ directly to just say:
LoadANDCompareMaps(bstingpath1, bstringpath2, etc)
The solution to my priblem is quite simple:
I was declaring my binary strings incorrectly
correct syntax:
BSTR bla = SysAllocString(L"C:\\temp\\TestDLL3.bmp_BGL.bmp");
Thank you
Sincerely,
Max Pastchenko
P.S. I debugged on VB side with C++ executable and thats how I found that they were empty. And as far as i see C++ is talking to a .NET DLL which is created by VB.NET
|
|
|
|
|
Hi
I wrote my own custom control (derived form CTreeCtrl) where you can add several buttons (with unique IDs ...). The problem is now: How can I pass the messages (BN_CLICKECKD etc) to the frame window to handle? First they are send to the parent (the custom control) but I can't handle them there because the control doesn't know the IDs off the buttons at compilation time. But the frame (a CFormView) does know so how can I make the custom control pass the messages on to its parent.
I saw this some time before and I think the solution is some change in the PreCreateWindow(..) method but I can't remember (and I can't find the code either)!!
Please help
|
|
|
|
|
Does anyone know of any iSeries AS400 APIs?
|
|
|
|
|
Are you referring to an API on the AS/400 itself, or an API on the PC that can communicate with the AS/400? They are vastly different.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
An API on the PC that can communicate with the AS/400.
|
|
|
|
|
Yep, that's the one I use every day. What exactly did you want to know? If you have the Client Access CD, just install it on your PC and it will ask you if you want the toolkit. Doing so will give you the necessary lib, dll and h files that you can use to build with.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi and thanks!!
My problem is this:
I'm trying to send the bytes of a file from server to client via TCP packets, using a character array. I am using a CFile to read the file on server side, and write to it on client side.
I do this on server side:
CFile sourceFile;
char data[4096];
int read = sourceFile.Read(data, 4096);
send(clientsock,data,read, 0);
And on client side,
int ret = recv(serversock, message, messagelen, 0);
For some reason, although the 'read' int says it reads 738 bytes, which is correct, the 'data' character array only contains 4 bytes, the first four of the file. The client only receives the first 4 bytes also. What might I be doing wrong?
The file I'm sending is jpg image format.
Thanks a lot!
Kelly Ryan
|
|
|
|
|
JPG files contain zero's and text strings end with zero's. Maybe check you aren't getting end of string markers where you don't expect them.
HTH.
|
|
|
|
|
Looks like that's what it is, if I run through the data array and print out anything that isn't a zero up until the bytes read from the Read call, the rest of the file is there. I guess I'll have to replace all the 0's with something else when I send the array and then send another message to the client telling which slots in the array to re-replace with zeros before writing to file... does anybody know of a better way to do this?
Thanks!
Kelly Ryan
|
|
|
|
|
Nevermind, got it working, thanks.
Kelly Ryan
|
|
|
|
|
KellyR wrote:
does anybody know of a better way to do this?
The way I understood it, the client is already receiving the correct content, which includes zeroes. What are you doing with this data at the client end? Writing a local file? The zeroes in the array will represent a problem only if you intend to treat such binary content as if it were text, that is for example, if you try to write it to a file in text mode, or if you call string related functions on it.
If you are writing a file at the client end, make sure you open it in binary mode, and that's all you need.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
In an MFC application, how can I prevent a modeless CDialog from becoming the active window?
Look at the example code - I'm fading in a CWnd, and it fades away unless the user hovers over it. if the user ignores it the window fades away and the program exits. I want to acheive the same thing but with a CDialog so that I can use a dialog template but I can't find a way of preventing the dialog from becomming active. If there is a way to use a dialog template for a vanilla CWnd this would serve the same purpose.
<code>
#include <afxwin.h>
#include <afxext.h>
#include "resource.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
class CTinyApp : public CWinApp
{
public:
virtual BOOL InitInstance();
BOOL RegisterWNDCLASS();
};
CTinyApp theApp;
BOOL CTinyApp::RegisterWNDCLASS()
{
WNDCLASS wndclass;
wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = ::DefWindowProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = AfxGetInstanceHandle();
wndclass.hIcon = LoadIcon(IDR_MAINFRAME);
wndclass.hCursor = LoadCursor( IDC_ARROW );
wndclass.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = "MyTinyWnd";
if( !AfxRegisterClass( &wndclass ))
{
TRACE("Window class MyTinyWnd could not be registered.\n");
return FALSE;
}
return TRUE;
}
class CTinyWnd : public CWnd
{
DECLARE_DYNAMIC(CTinyWnd)
public:
CTinyWnd();
void ComeAlive();
protected:
DECLARE_MESSAGE_MAP();
public:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnBnClickedOk();
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
int m_nTimer;
int m_nLevel;
CButton m_cOKButton;
CFont m_Font;
};
IMPLEMENT_DYNAMIC(CTinyWnd, CWnd)
BEGIN_MESSAGE_MAP(CTinyWnd, CWnd)
ON_WM_TIMER()
ON_WM_SHOWWINDOW()
ON_WM_ACTIVATE()
ON_WM_CREATE()
ON_WM_NCMOUSEMOVE()
ON_WM_MOUSEMOVE()
ON_BN_CLICKED(IDOK, OnBnClickedOk)
END_MESSAGE_MAP()
CTinyWnd::CTinyWnd() : m_nTimer(-1), m_nLevel(3)
{
}
void CTinyWnd::ComeAlive()
{
if (m_nTimer != -1)
{
KillTimer(m_nTimer);
m_nTimer = -1;
}
ModifyStyleEx(WS_EX_LAYERED,0);
}
void CTinyWnd::OnBnClickedOk()
{
KillTimer(m_nTimer);
m_nTimer = -1;
DestroyWindow();
delete this;
}
void CTinyWnd::OnTimer(UINT nIDEvent)
{
CWnd::OnTimer(nIDEvent);
static bool bDir = true;
if (m_nTimer == nIDEvent)
{
if (bDir)
m_nLevel+=2;
else
m_nLevel--;
if (m_nLevel > 3)
{
if (m_nLevel > 254)
bDir = !bDir;
SetLayeredWindowAttributes(0, m_nLevel, LWA_ALPHA);
RedrawWindow(NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_FRAME|RDW_ALLCHILDREN);
}
else
{
KillTimer(m_nTimer);
m_nTimer = -1;
DestroyWindow();
delete this;
}
}
}
int CTinyWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
m_cOKButton.Create("OK",
WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON|BS_TEXT,
CRect(60,20,140,60),
this,
IDOK);
m_Font.CreatePointFont(80,"MS Shell Dlg");
m_cOKButton.SetFont(&m_Font);
return 0;
}
void CTinyWnd::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
CWnd::OnActivate(nState, pWndOther, bMinimized);
ComeAlive();
}
void CTinyWnd::OnShowWindow(BOOL bShow, UINT nStatus)
{
CWnd::OnShowWindow(bShow, nStatus);
static bool bFirst = true;
if (bFirst)
{
bFirst = false;
m_nLevel = 3;
SetLayeredWindowAttributes(0, m_nLevel, LWA_ALPHA);
m_nTimer = (int)SetTimer(1,50, NULL);
}
}
void CTinyWnd::OnMouseMove(UINT nFlags, CPoint point)
{
static bool bFirst = true;
if (bFirst)
{
ComeAlive();
bFirst = false;
}
}
void CTinyWnd::OnNcMouseMove(UINT nHitTest, CPoint point)
{
static bool bFirst = true;
if (bFirst)
{
ComeAlive();
bFirst = false;
}
}
BOOL CTinyApp::InitInstance()
{
RegisterWNDCLASS();
CTinyWnd* pWnd = new CTinyWnd;
BOOL bCreate = pWnd->CreateEx(WS_EX_TOOLWINDOW|WS_EX_LAYERED,
"MyTinyWnd",
"Popup Message",
WS_BORDER|WS_POPUP|WS_CAPTION,
CRect(200,200,400,300),
NULL,
0, 0);
if (!bCreate)
{
delete pWnd;
return FALSE;
}
m_pMainWnd = pWnd;
m_pMainWnd->ShowWindow(SW_SHOWNA);
m_pMainWnd->UpdateWindow();
return TRUE;
}
</code>
|
|
|
|
|
mintguy wrote:
In an MFC application, how can I prevent a modeless CDialog from becoming the active window?
Try removing the Visible style (WS_VISIBLE ) from the dialog template, then creating the dialog window using CDialog::Create , and then making it appear using CWnd::ShowWindow with SW_SHOWNOACTIVATE .
CFadingDialog dlg;
dlg.Create(IDD_FADING);
dlg.ShowWindow(SW_SHOWNOACTIVATE);
mintguy wrote:
If there is a way to use a dialog template for a vanilla CWnd this would serve the same purpose.
You might take a look at the implementation of MFC's CFormView class.
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
In Continuation with Jose!, you can also achieve same by returning FALSE instead of TRUE from the OnInitDialog 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
|
|
|
|
|
Doesn't work. Try it and see.
|
|
|
|
|
mintguy wrote:
Doesn't work. Try it and see.
Have you urself tried this,i.e. returning FALSE instead of TRUE from OnInitDialog Function.
AnyWays where is code of CDialog based Class implemented by you
"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
|
|
|
|
|
Yes sorry it does work, apologies. I was mssing all three elements together i.s. SHOW_NA, WS_VISIBLE and returning FALSE from OnInitDialog.
Thanks very much for your help.
|
|
|
|
|
mintguy wrote:
apologies.
No need of that!
"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
|
|
|
|
|
Doesn't work. please try it and see.
|
|
|
|
|
It turns out you need to combine what I said with what Alok said. That is:
- 'Visible' as FALSE in dialog template
- Return FALSE in CFadingDlg::OnInitDialog
- Create the dialog with Create()
- Show the dialog with ShowWindow(SW_SHOWNOACTIVATE)
I've just tried this and it worked.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Ahh yes. Apologies. Thanks very much. I'm sorry I said it didn't work.
The WS_VISIBLE style is the key part I was missing actually. I had tried the rest myself earlier.
Thanks again.
|
|
|
|
|