15,897,704 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 Member 11593571 (Top 54 by date)
Member 11593571
3-Sep-16 14:22pm
View
'Starting tomcat v9.0 Server at localhost' has encountered a problem. Server Tomcat v9.0 server at localhost failed to start. is the fulls error and the error occures at Session session = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
Member 11593571
19-Jun-16 18:46pm
View
Deleted
anyone have any idea of what to do?
Member 11593571
19-Jun-16 15:18pm
View
oh boy, even if i do it just by cout << "ซ" << endl; it prints α╕ï. so what would you say now?
Member 11593571
19-Jun-16 12:58pm
View
i have tried solution 1 and 2 over and over but no changes, and i commented to Sergey Alexandrovich Kryukov reply if you would read it.
Member 11593571
19-Jun-16 12:57pm
View
first of all without typecasting buf to (char*) it doesn't compiles it, so i had to do it this way: write_on.write((char*)buf, wcslen(buf) * sizeof(wchar_t)); but still no changes made and still getting VT and SO instead of my custom character.
Member 11593571
19-Jun-16 8:56am
View
i am using windows
Member 11593571
18-Jun-16 20:39pm
View
yeah i changed it to sizeof(wchar_t) or strlen(L"ซ").i think it fixes the bug but doesn't fix my problem, so do you have any idea of how can i write ซ in my text file?
Member 11593571
18-Jun-16 19:05pm
View
i read all the links you gave me above, it was useful but didn't helped me fix my problem, as you said my character is two bytes and wchar_t can store two bytes too, then no problem with the way i input it right? and as i said above, this is how i read the data Read_From.open(Read_File_Name, ios::binary | ios::in); Read_From.read(buf, sizeof(wchar_t)); but no luck there, i really don't know what am i doing wrong, and what to do. but there is one thing that if i use one of ascii characters it works just perfect.
Member 11593571
18-Jun-16 14:32pm
View
o.k i just changed 1 to sizeof(wchar_t), now it is inputing one more character than the buffer data itself contains, before i mean with write_on.write(buf, 1); it was converting my custom character to (VT) but the way you said as sizeof(wchar_t) it is adding (SO) over just for nothing, and this is the way i read data
Read_From.open(Read_File_Name, ios::binary | ios::in); Read_From.read(buf, sizeof(buf)); i also have tried Read_From.read(buf, 1);
Member 11593571
18-Jun-16 11:51am
View
well if you think it has something to do with text editor, this time i wrote the character and read it through my code no text editor needed, but still no difference, and thanks for your reply
Member 11593571
30-Aug-15 11:22am
View
hey what is going on, I can't find either of my comment and solutions.
Member 11593571
30-Aug-15 1:28am
View
hey where did all of my comments go?
Member 11593571
29-Aug-15 9:19am
View
I really really am sorry. but I unfortunately can't understand you mean by use the new nPos value to move the button. could you show me how to use nPos and how to change its position.
Member 11593571
28-Aug-15 3:14am
View
alright look, the thing is that I don't how to find out if the user has scrolled down 1000 line, if I try add this if(si.nPos > 1000) si.nMax = 2000; after if(pos == -1) would it work
Member 11593571
26-Aug-15 14:08pm
View
anybody help me out with this.
Member 11593571
26-Aug-15 10:25am
View
okay that didn't worked, there is one more thing I think I can do, what if I tell the scroll bar that if the user scrolled like 1000 lines extend the si.nMax value. well i can't do it without your help cause i don't know how to do that, so i would really appreciate if you tell how to do that.
Member 11593571
24-Aug-15 14:27pm
View
alright do you mean, instead of scrolling the window itself tell the scrollbar not to scroll the window but to set a new position to the buttons, am i right?
Member 11593571
23-Aug-15 5:15am
View
Deleted
oh come on somebody reply me
Member 11593571
22-Aug-15 13:45pm
View
you said that I could paint pixels instead of moving it, but unfortunately I don't know how its done. I would be really thankful if you tell me how to do that.
Member 11593571
22-Aug-15 0:06am
View
Deleted
I am in a bit confusion out there. do you mean i should get all the code from WS_VSCROLL and bring it to WM_PAINT. and If I don't use scrollwindow then what should I use?
Member 11593571
14-Aug-15 4:55am
View
anyone can help me?
Member 11593571
13-Aug-15 12:40pm
View
can't believe i am saying this. but i need an new solution. i mean the above answer worked perfect but i thought instead of using mdiclient it would be good to use our self drawn window with its own class style. but in this one i can't add ws_vscroll or ws_hscroll, i mean i can but when i try to scroll down or something it just jump back to the top. so i would appreciate is somebody tell me how can i achieve creating the scroll bars to a self drawn window.
Here is the code how i create the window and class
Code:
wcs.cbSize = sizeof(wcs);
wcs.lpszClassName = szClassName;
wcs.hInstance = GetModuleHandle(0);
wcs.lpfnWndProc = CustWndProc;
wcs.hCursor = LoadCursor(NULL, IDC_ARROW);
wcs.hIcon = 0;
wcs.lpszMenuName = 0;
wcs.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcs.style = 0;
wcs.cbClsExtra = 0;
wcs.cbWndExtra = 0;
wcs.hIconSm = 0;
if(!RegisterClassEx(&wcs))
{
MessageBox(NULL, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
hwndCtrl = CreateWindowEx(
0L, // give it a standard border
szClassName,
_T("A custom control"),
WS_VISIBLE|WS_CHILD|WS_VSCROLL|WS_BORDER,
0, 0, 0, 0,
hWnd,
NULL, GetModuleHandle(0), CustWndProc
);
thanks in advance
Member 11593571
10-Aug-15 5:13am
View
Thank you, fixed it, the problem was that i was trying to make it in hwndCtrl which i was suppose to put hwnd instead. and now it works perfect there is no problem of pumping messages. but anyway thank for you help
Member 11593571
10-Aug-15 0:08am
View
i read all the documents you said and i did the way they are doing, could please tell me a particular point where i should pump message at.
Member 11593571
9-Aug-15 15:23pm
View
thanks sir, i think you are talking about wm_create to return something. i did added return 0; before break for wm_create which i think you know what that mean better than but still no result.
Member 11593571
9-Aug-15 9:04am
View
least i made it working, and there is another problem, WM_CREATE does not works i mean the rest works fine like wm_paint and others work fine , but WM_CREATE doesn't here is my code:
LRESULT CALLBACK CustWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CREATE:
HWND Button1; // The name of the button will be Button1
Button1 = CreateWindowEx(WS_EX_CLIENTEDGE, "BUTTON", "Text on button", WS_CHILD | WS_VISIBLE, 0, 0, 30, 30,hwndCtrl, (HMENU)3, GetModuleHandle(0), 0);
break;
case WM_PAINT:
HDC hdc;
PAINTSTRUCT ps;
hdc = BeginPaint(hwndCtrl, &ps);
EndPaint(hwndCtrl, &ps);
default:
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindow(szWindowClass, "FindMe", WS_OVERLAPPEDWINDOW/*WS_OVERLAPPED | WS_MINIMIZEBOX | WS_SYSMENU*/,
CW_USEDEFAULT, 0, 1014, 585, NULL, NULL, hInstance, NULL);
if (!hWnd)
{
return FALSE;
}
WNDCLASSEX wcs;
wcs.cbSize = sizeof(wcs);
wcs.lpszClassName = szClassName;
wcs.hInstance = GetModuleHandle(0);
wcs.lpfnWndProc = CustWndProc;
wcs.hCursor = LoadCursor(NULL, IDC_ARROW);
wcs.hIcon = 0;
wcs.lpszMenuName = 0;
wcs.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcs.style = 0;
wcs.cbClsExtra = 0;
wcs.cbWndExtra = 0;
wcs.hIconSm = 0;
if(!RegisterClassEx(&wcs))
{
MessageBox(NULL, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
hwndCtrl = CreateWindowEx(
0L, // give it a standard border
szClassName,
_T("A custom control"),
WS_VISIBLE|WS_CHILD|WS_VSCROLL|WS_BORDER,
0, 0, 0, 0,
hWnd,
NULL, GetModuleHandle(0), NULL
);
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
as you can see it is suppose to make me a button but it basically doesn't, the rest works fine i mean like if i try to create a rectangle using wm_paint it works okay.
any solution are really appreciated
Member 11593571
8-Aug-15 0:32am
View
well how am i going to store bitmaps in memory, if i create a bitmap in resources of my project would it store it in memory
Member 11593571
7-Aug-15 0:26am
View
hey can anybody answer me?
Member 11593571
6-Aug-15 16:24pm
View
Deleted
can anybody help me?
Member 11593571
5-Aug-15 14:41pm
View
oh man the thing you recommended works perfect but now there is another problem, how do i change the picture when the mouse cursor is on the button. like when you bring your mouse pointer on a normal button the color changes a to a little blue, how am going to do that in my bitmap kind of button. and thank
Member 11593571
2-Aug-15 15:41pm
View
yes, but do you see anything i am doing wrong in my code
Member 11593571
2-Aug-15 12:38pm
View
first of all sorry for my late reply, next i read the whole article in that website above, but that does not work as it suppose to i mean if you call wm_create and add some line of code to create you a button or on wm_paint when you try to create a rectangle or something it just does not work but the compiler compiles it without any error or something. here is the code how i am doing this
Code:
LRESULT CALLBACK WndProcclient(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_LBUTTONDOWN:
{
char szFileName[MAX_PATH];
HINSTANCE hInstance = GetModuleHandle(NULL);
GetModuleFileName(hInstance, szFileName, MAX_PATH);
MessageBox(hwnd, szFileName, "This program is:", MB_OK | MB_ICONINFORMATION);
}
break;
case WM_CREATE:
HWND Button1; // The name of the button will be Button1
Button1 = CreateWindowEx(0, "BUTTON", "Text on button", WS_CHILD | WS_VISIBLE, 220, 0, 100, 20,hwnd, (HMENU)3, hInst, 0);
break;
case WM_PAINT:
HDC Chdc;
PAINTSTRUCT pa;
Chdc = BeginPaint(hwndClient, &pa);
if(!Rectangle(Chdc, 0,0,10,10))
MessageBox(NULL, "Error while creating rectangle", "Error", MB_OK);
EndPaint(hwndClient, &pa);
break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
HWND ChildWindowCreation(HWND hWnd){
const char g_szClassName[] = "myWindowClass";
WNDCLASSEX wc;
HWND hwnd;
MSG Msg;
HINSTANCE clientInst;
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProcclient;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = clientInst;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+25);
wc.lpszMenuName = NULL;
wc.lpszClassName = g_szClassName;
wc.hIconSm = NULL;
if(!RegisterClassEx(&wc))
{
MessageBox(NULL, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
hwndClient = CreateWindowEx(WS_EX_CLIENTEDGE, "MDICLIENT", NULL, WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE|WS_VSCROLL,
0, 0, 0, 0, hWnd, (HMENU) 1, clientInst,(PSTR)&clientcreate) ;
if(!hwndClient){
MessageBox(NULL, "Program did not made the stuff ready for you", "Error", MB_OK|MB_ICONERROR);
}
return hwndClient;
}
hope there is a solution for that,
Member 11593571
28-Jul-15 15:54pm
View
the link is for controlling message not for creating handlers for windows controls,
Member 11593571
27-Jul-15 23:38pm
View
Deleted
anybody have any idea?
Member 11593571
27-Jul-15 13:39pm
View
hey bro there are laterally hundreds of link on each website you give me above so its kind of hard to find it, i mean i had my research there but no luck there, so i would be owner if you give me a specific link to help me with my problem and thanks for your help i appreciate it
Member 11593571
26-Jul-15 15:16pm
View
those website are really useful, but unfortunately i have to say i didn't found what i wanted, and thanks for you reply
Member 11593571
26-Jul-15 10:03am
View
sorry could you redirect me to a tutorial where it could show me how its done?
Member 11593571
26-Jul-15 9:58am
View
anybody have any idea what to do?
Member 11593571
26-Jul-15 4:06am
View
Deleted
sorry could you redirect me to a tutorial where it could show me how its done?
Member 11593571
19-Jul-15 4:16am
View
Thanks for your answer it worked perfectly, one more thing if you could tell me, how do I change the MDIClient background color.
Member 11593571
7-Jul-15 9:18am
View
can anybody tell me what to do?
Member 11593571
6-Jul-15 12:48pm
View
my dear brother guess you didn't understand me completely, let me explain it a little clearly, there is a textbox in my hWnd window, what i want it, is to when the user types something and pressed enter it should get the text and draw it in the window somewhere or something like that. and thanks for your help.
Member 11593571
5-Jul-15 18:30pm
View
yeah you are right i didn't got any result means no text no where in window, and i can't do it the way you did, i mean you called UpdateGraph() function in wm_paint handler but i can't do that cause there are lots of other stuff in my function where drawtext is, i mean the function that calls DrawText()
Member 11593571
5-Jul-15 15:54pm
View
i did the way you said above but still no result, isn't there any other better way to show a small piece of text in window
Member 11593571
5-Jul-15 15:22pm
View
what's with the link
Member 11593571
4-Jul-15 15:50pm
View
Deleted
thanks then i may try a solution you said.
Member 11593571
4-Jul-15 15:44pm
View
i don't understand what do you mean by application-level command protocol, could you please tell give me an example?, and is it possible to use to different port in an application
Member 11593571
4-Jul-15 15:32pm
View
well i can create threads, but how the program is going to recognize that voice packet belong to voice thread and text packet belong to text thread. i mean let's say the client sent a text packet to server so how the server is going to recognize that this is a text packet which need to go to text thread? one more thing it does not hang the program. it just does not recognize it.
Member 11593571
24-Jun-15 10:02am
View
thanks,i made to create a new thread
Member 11593571
24-Jun-15 9:31am
View
can you tell me how to do this
Member 11593571
24-Jun-15 7:36am
View
you mean calling accept() in the main function, right
Member 11593571
24-Jun-15 6:19am
View
i didn't understand you, what do you mean.
Member 11593571
19-May-15 14:42pm
View
how am i suppose to do that, i mean this is how it's made:-
private: Microsoft::VisualBasic::PowerPacks::DataRepeater^ dataRepeater1;
and
this->dataRepeater1->ItemTemplate->BackColor = System::Drawing::SystemColors::ControlDarkDark;
this->dataRepeater1->ItemTemplate->Size = System::Drawing::Size(232, 72);
this->dataRepeater1->Location = System::Drawing::Point(12, 158);
this->dataRepeater1->Name = L"dataRepeater1";
this->dataRepeater1->Size = System::Drawing::Size(240, 150);
this->dataRepeater1->TabIndex = 2;
this->dataRepeater1->Text = L"dataRepeater1";
this->dataRepeater1->CurrentItemIndexChanged += gcnew System::EventHandler(this, &Form1::dataRepeater1_CurrentItemIndexChanged);
Member 11593571
19-May-15 6:27am
View
sorry but i didn't understand you. what do you mean translate VB-Code to vc++.
Show More