15,891,943 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by MickFarrell (Top 14 by date)
MickFarrell
15-Apr-20 12:43pm
View
I agree, I'd rather double check than assume. We're going to roll back to the previous SDK's when the issue wasn't present and run some testing.
The whole project is made up of over 1 million lines of code with a mix of c, c++, clr, c#, .net, ASP.net and there's only about 10 places where this happens, and it only happens under very strange conditions that we haven't yet identified.
I do have a work around but I don't want to implement unless we really need to.
MickFarrell
15-Apr-20 10:56am
View
Yes it is the ID of the actual edit control and not the ID of a resource string.
MickFarrell
15-Apr-20 7:02am
View
All good points Steve, and yes the default is IDC_ I have tried adding a new edit control and left it at the default define IDC_EDIT and even the new edit control doesn't work. I'm pretty sure your suggestion would work, if I use the following code (added a CString) it works 100% of the time for all users:
void CUserPromptDlg::TestFunc1()
{
GetDisplayPrompt(m_UserPrompt);
CString temp = m_UserPrompt
SetDlgItemTextW(IDS_USER_PROMPT, temp);
}
I removed the AfxMessageBox(m_UserPrompt) as that is just for testing, it has no impact.
I think you may have been onto something with your previous question about the language and regional settings. We created a few new test accounts on Azure for some testers to test with.
Tester1 logs into Azure using an Azure user account "AzureTest1" and the text is missing.
Tester2 logs into the same Azure account "AzureTest1" and the text appears for him.
Tester1 used his second PC to log into Azure using the Azure account "AzureTest1" and the text appears.
It seems to be some how related to settings on a local PC been passed into the Azure account when logging in? They are checking local and regional settings to see if they can narrow it down
Thansk for your help and suggestions Steve!
MickFarrell
15-Apr-20 6:51am
View
Hi Richard, I've check to make sure that the IDS_USER_PROMPT id is unique and I have even added a new Edit box to the dialog to test and the text still appears blank in the new Edit box as well.
I did try using ::SetWindowText and ::SetWindowTextW (::SetWindowTextA won't compile as its a UNICODE project) and they both return true even when they don't display the text.
I have some of the testers doing some extensive testing on Azure and we did find something very interesting.
Tester1 logs into Azure using an Azure user account "AzureTest1" and the text is missing.
Tester2 logs into the same Azure account "AzureTest1" and the text appears for him.
Tester1 used his second PC to log into Azure using the Azure account "AzureTest1" and the text appears.
It seems to be some how related to settings on a local PC been passed into the Azure account when logging in? They are checking local and regional settings to see if they can narrow it down
Again thanks Richard for your time and input, its always very good to get some other ideas.
MickFarrell
15-Apr-20 4:27am
View
It is a unicode program so SetWindowText is SetWindowTextW. The SetWindowText (SetWindowTextW or SetWindowTextA) does not return a value. You're mixing up the win32 api ::SetWindowText (::SetWindowTextW or ::SetWindowTextA) which does return true or false.
You have givien me an idea, I will try calling the win32 version and see what it returns? thanks
MickFarrell
14-Apr-20 13:33pm
View
Hi Richard,
It is declared in the header file. I did include it in my original post.
// Declared in the Header file
WCHAR m_UserPrompt[128];
MickFarrell
14-Apr-20 12:58pm
View
Hi Richard, In regard to your previous solution, what was missing? You said "You appear to be using different variables for the text" but its there in the code calling a function to set the text?
A problem in the header file would not cause the text to only work if running in Admin mode. Running in Admin mode is the only way "I" can replicate the problem, for some users it just happens as they run it normally
I really do appreciate your time, input and suggestions and I do believe the problem is deeper than the small sample of code I have provided but I'm hoping someone may have come across something similar in the past and could point me in another direction. :-)
MickFarrell
14-Apr-20 12:23pm
View
Hi Steve, m_UserPrompt isn't bound to any DDX, it is just a WCHAR array with plenty of room. The text box in the dialog has plenty of room and displays the text prefectly when not run as an Administrator.
MickFarrell
14-Apr-20 12:16pm
View
Hi Richard, One is a pointer to the WCHAR array. m_UserPrompt is declared in the header file.
Solution 1: If I moved m_UserPrompt from the Header file and declare it in the class function TestFunc1() as a local variable it works fine.
Solution 2: If I copy the contents of m_UserPrompt to a CString it works fine.
This has me completely puzzled?? I'm convinced the problem is UNICODE related but I can't figure it out?
MickFarrell
14-Apr-20 11:51am
View
Hi Richard,
I have simplified the code as much as possible to test and I only use the basic CDialog with no WM_PAINT message handling. The same code works fine but does not display text when run in Admin mode?
MickFarrell
14-Apr-20 11:51am
View
Hi Richard,
I have simplified the code as much as possible to test and I only use the basic CDialog with no WM_PAINT message handling. The same code works fine but does not display text when run in Admin mode?
MickFarrell
14-Apr-20 11:49am
View
I checked with 4 users and they all have their language and regional settings set to EN(US). One of those users has the display issue
MickFarrell
14-Apr-20 10:35am
View
Hi,
I will check with a couple of the users to see if they have different language setups on their PC's.
If it is a problem with language setups why would it happen to me when I run in Admin mode but not when I don't?
MickFarrell
14-Apr-20 10:33am
View
Hi, it is included above, not sure why you can't see it but here it is
// Declared in the Header file
WCHAR m_UserPrompt[128];
// CPP implementation file
void CUserPromptDlg::GetDisplayPrompt(WCHAR *pUserPrompt)
{
wcscpy(pUserPrompt, L"Test message");
}
void CUserPromptDlg::TestFunc1()
{
GetDisplayPrompt(m_UserPrompt);
AfxMessageBox(m_UserPrompt);
SetDlgItemTextW(IDS_USER_PROMPT, m_UserPrompt);
}
Show More