|
I tried your code on a visual studio 2005 compiler and it is compiling fine.
-Suhredayan
|
|
|
|
|
It's one thing asking for help - it's another thing expecting us to do your job for you.
You don't read the posting guidelines, so your quoted code is just a slab of text I have no intention of reading.
You don't give any actual errors.
In a reply to another reply, you give some example errors - which sound like things you can fix yourself.
"If a function is missing return..." Then [bleep]ing fix the code so it isn't missing a return!
"...doesn't expand inline". 1/ so what? the compiler is free to make judgements. inline is only a recommendation. 2/ How do you even know it doesn't? 3/ From memory, inline expansion is not done in debug mode.
Also, even if you get the code to compile, that's no reason to say it "wrkz". We don;t know your requirements, so we can't fix all errors.
I wish you luck with your debugging,
Iain.
|
|
|
|
|
Hi all,
I'm a beginner and have a beginner question. I want to create a WinForm in C++. I created a Win32 Console Application in VS2008 and write these codes to create a WinForm (They're exactly what I saw in my ebook):
#include "stdafx.h"
#include "windows.h"
INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, INT)
{
WNDCLASSEX wc = {sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L
GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
TEXT("TEST"), NULL};
RegisterClassEx(&wc);
HWND hWnd = CreateWindow(TEXT("TEST"), TEXT("TEST"),
WS_OVERLAPPEDWINDOW, 100, 100, 512, 512,
GetDesktopWindow(), NULL, wc.hInstance, NULL);
}
What is MsgProc ? I have error on this line. error C2065: 'MsgProc' : undeclared identifier.
Thank you in advance.
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
That code has nothing to do with "WinForms" - whatever "WinForms" are (?).
That's basic window creation, and it's pretty much the fundamental concept
in Windows programming.
I would strongly suggest studying at least the windowing overviews here:
Windowing[^]
especially the sections Windows, Window Classes, Window Procedures, and Messages.
The Window Procedures section will explain what the MsgProc parameter is.
It's not difficult to understand, but it is essential knowledge for effective
Windows programming
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks a lot Mark. Reading your link
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
Seems you've started learning SDK style win32 programming. Well, I recommend you to read "Talk to me like I'm a 3 year old!" programming series by GameTutorials at first. Check it here[^].
Once you finished reading it, you'll find out the answer for your problem, yourself!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks Jijo. I'm reading your link. I wonder what are those question marks (�) for? (Maybe I don't know the page Encoding!)
Jijo raj wrote: "Talk to me like I'm a 3 year old!"
Actually "A 3 hour old!"
However thank you.
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
Pedram Behroozi wrote: Thanks Jijo. I'm reading your link. I wonder what are those question marks (�) for? (Maybe I don't know the page Encoding!)
Me too had the same problem. It could be character encoding problem as you said.
Pedram Behroozi wrote: Actually "A 3 hour old!" Laugh
New Born SDK Baby!
Well, wish you all the best.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Pedram Behroozi wrote: I wonder what are those question marks (�) for? (Maybe I don't know the page Encoding!)
Looks like a firefox issue. Worked well on IE6.
|
|
|
|
|
You're right. Obvious!
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
Hi,
I have a multiline CEdit control with some text. I want to find a word in this Edit control.
But I am not able to find the ans of following question.
1. How to get some string or part of string in between the CEdit control.?
2. Then if string matched how to make that word highlight?
|
|
|
|
|
I'm a bit rusty on this, but here goes
1) assign a member variable of type CString to the Edit Control. eg m_MyEdit .. you can then go CString someText = m_MyEdit .. you'd then need to parse this string in someText to find your word - maybe parse by spaces and or keywords
2) dont think you can do this 'simply' - I know you can change the font color and or background for the whole control, but not for a single words as part of a string - you may need an owner draw control using a 'light' rtf syntax or even better do it using a html type display - there are examples of each here on CP
'g'
|
|
|
|
|
MPTP wrote: 2. Then if string matched how to make that word highlight?
Doesn't SetSel [^] fit your needs, does it?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
good thinking - I was thinking in a different context ...
btw, how was your Holiday ? (I expect to be in Europe, especially Lago di Como, next year, from 18th Sept to 4th Nov)
'g'
|
|
|
|
|
Garth J Lancaster wrote: btw, how was your Holiday ?
Good, thank you.
Garth J Lancaster wrote: (I expect to be in Europe, especially Lago di Como, next year, from 18th Sept to 4th Nov)
No visit to Roma? Uhmmmmmmmmmmm
BTW welcome to the THHB [^] [^], Garth!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: BTW welcome to the THHB
chuckle - not sure wether to laugh or cry - since there's a smiley face in your post I'll stick with laugh
CPallini wrote: No visit to Roma? Uhmmmmmmmmmmm
not this time unfortunately, I realise that must almost be a sin - I was there a few years ago - spent 5 glorious weeks in Italy, but I have limited time next trip so I want to visit somewhere I missed first time round
If I had an unending supply of $$ I'd live in Europe 6 months of the year, but I'll never see all the places I want to
ciao !!
|
|
|
|
|
Garth J Lancaster wrote: I'll stick with laugh
Good, after all it is a happy brigade!
Garth J Lancaster wrote: not this time unfortunately, I realise that must almost be a sin - I was there a few years ago - spent 5 glorious weeks in Italy, but I have limited time next trip so I want to visit somewhere I missed first time round
Ah, OK. But what about Florence, Venice? Maybe you already been there.
Garth J Lancaster wrote: If I had an unending supply of $$ I'd live in Europe 6 months of the year, but I'll never see all the places I want to
Don't be sad, I never been in Australia, so far...
Ciao!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
in order, we visited Roma, Sorano, Siena, San Gimignano, Florence, Lucca, Pisa, Levanto (Cinque Terre), Binasco (Milan), Trento, Venice (and a miriad of places in-between), most of those (the bold ones) were major stops we used as a base
My brother studied in Italy for a period of time, and between us we did a good job of speaking Italian - a lot of places people nearly mistook us for locals - we had to ask them to slow down and speak tourist to us
Ahhh, the people, the sights, the food
CPallini wrote: Don't be sad, I never been in Australia, so far...
yeah, its a long way, but worth it
arriverderci
|
|
|
|
|
I set the selection but in the strange way. I have same text in 8 lines.
Only first line it show the selection in the best way but for others is shows the selection only half of the word.
This is my code
for (int nLine=0;nLine<m_edfilecontent.getlinecount();nline++)>
{
memset(tcBuffer,0x0,_MAX_PATH);
int nTotalCharInaLine=m_edFileContent.GetLine(nLine,tcBuffer,_MAX_PATH);
int nLengh=g_szFindText.GetLength();
for (int nChar=0;nChar<ntotalcharinaline;nchar++)>
{
if(memcmp(tcWord,tcBuffer+nChar,g_szFindText.GetLength())==0)
{
nTotalOcc++;
m_edFileContent.SetSel(nCharCount+nChar,nCharCount+nChar+nLengh,FALSE);
Sleep(2000);
}
}
nCharCount+=nTotalCharInaLine;
}
|
|
|
|
|
hi,
use function as follow:
1. CString szText = xxxctrl.GetWindowText();
by szText, you will get substring you want.
2. EditCtrl.SetSel(nStart,End), it will set substring to highlight.
nstart is the begin position of selection char by bytes, and nEnd is last
|
|
|
|
|
I am trying to install a local service under the context of a trusted domain account.
I installed the service correctly and it starts fine running under the LocalSystem context, however the service fails to start under the domain account because of a logon failure.
The domain account I am using meets all of the following requirements. Please tell me if I am missing anything:
1). Account is enabled/unlocked
2). Account password I am using is valid (logged into a few machines with it)
3). Account has local admin rights on the machine I am installing the service on
Attached is the CreateService() function I am using to install the service.
Thank you
TCHAR szPath[MAX_PATH] = (L"\"C:\\Program Files\\Temp.exe\"");
TCHAR szStartName[50] = (L"Domain\\User");
TCHAR szStartNamePassword[50] = (L"**********");
schService = CreateService(
schSCManager,
SVCNAME,
SVCNAME,
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS,
SERVICE_AUTO_START,
SERVICE_ERROR_NORMAL,
szPath,
NULL,
NULL,
NULL,
szStartName,
szStartNamePassword);
|
|
|
|
|
Make sure that the Domain\User account has the LogOnAsService right granted.
|
|
|
|
|
Graham, How do I set this programatically?
Thanks
|
|
|
|
|
|
Hey everybody!
I've been looking for a while for a way to get all print jobs being sent from the computer.
I tried to hook notepad and hook StartDocW and SetJobW, but nothing caught up.
Does anyone know of a way to hook the printing jobs?
Thanks a lot!!!
|
|
|
|
|