|
Er, anyone has a short and simple email validation code for C++? Need to look up the domain or anything. Just ensure that the text given would qualify as an email address.
Nish
p.s. Kindly don't answer me with "You can do that with one line of reg exps" cause I don't know jack about reg exps
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
|
Nish bangs his head repeatedly against the monitor!!! Not satisfied with that he lifts up the heavy tower and drops it on his feet! Satisfied with his thoroughly masochistic exercise he sits back and continues to stare incredulously at Tomasz’s reply
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Ok, when the pain is over, take a look here[^] and here[^]
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
Don't tell me an advanced programmer like you can't parse a string like mail@mail.org
For some reason I can't believe that
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have the following code in my program (written in C not C++):
typedef struct
{
char *(*errors)[];
}ERROR_LIST;
char *errors[]=
{
"An error",
"Another error",
};
ERROR_LIST err_list={&errors};
The declaration gives the following compiler error on the line indicated.
warning C4048: different array subscripts : 'char *(*)[]' and 'char *(*__w64 )[2]'
I am using the /w64 compiler switch intentionally to maintain 64bit compatibility.
Could somebody please give me a clue how to resolve this warning as its driving me nuts!
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
And like this ? :
<br />
typedef struct {<br />
char *(*errors)[];<br />
} ERROR_LIST;<br />
<br />
char *errors[];<br />
ERROR_LIST err_list={&errors};<br />
char *errors[]={"An error","Another error",};<br />
|
|
|
|
|
That works but can you explain why?
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
I'm not a guru but I suppose the the compiler interpret (well a compiler does'nt interpret code, but...) :
char *str[] = {"one", "two"};
as
char *str[2] = {"one", "two"};
I think (not shure) that your code might compile in old C but not in C++ (new behaviour).
|
|
|
|
|
I have an dll that write with MC++.How can I import it to my project?When I add #import line in my stdafx.h I got an error that it can't open this library file.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
r u given the path for #import directive?
other wise u can put the dll in your working directory
anju
|
|
|
|
|
|
Would you please give me more details Nish?How can I use it?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Okay here goes :-
- First use tlbexp on your mc++ dll to get the tlb file :-
tlbexp mcpp.dll /out:mcppdll.tlb
- Now register the dll using regasm
- Now simply
#import mcpp.tlb in your unmanaged C++ code and use it just as you'd use a normal COM dll
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Thank you Nish.
Does use it in this way reduce speed or performance in comparision to using unmanaged c++?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
|
Thanks Nish,I found my problem
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I think I forget my COM skills Nish,I have a problem with it.I register and import them into my project.I have some class in my dll.I can see them in my editor(CTRL+space) but when I compile them it gives me an error that they are undeclare identifier.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
How can i set a new icon in the toolbar of my MFC program at run-time ?
How to link the windows message sent when the user click the new button with a predefined function ?
Thanks !
|
|
|
|
|
I think you could just create the toolbar as normal.
Link the message map handlers as you would normaly.
But then set the state of the button to TBSTATE_HIDDEN with the SetState command.
When you want to *add* it just set the state to Not HIDDEN.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Ok ! It's an option.
Because I may create a lot of new windows, each of them with its own icon, i could predefined a lot of HIDDEN buttons. When I allocate a new wnd, i change the picture and make the icon active.
I don't know why, I don't like this method so much !
I will use it if there is noway.
Thanks Asim !
|
|
|
|
|
Use CToolbar::SetButtons() and a ON_COMMAND_RANGE handler.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
The CToolBar::GetToolBarCtrl() method returns CToolBarCtrl control which offers methods to manipulate the toolbar.
Sonork 100.15206;PavelK
|
|
|
|
|
Great, it works ! But... small, small problem.
When i create a new button, the toolbar is not big enough and the last one is no visible anymore. If i move the toolbar to another position in the window, it resize itself automatically and all the buttons become visible again.
I try adding Invalidate() and AutoResize(), but doesn't work. How to get the toolbar with the right width ?
void CMyAppView::OnAddNewModule()
{
CToolBarCtrl* pToolBarCtrl;
pToolBarCtrl = &(((CMainFrame*)GetParentFrame())->GetToolbar())->GetToolBarCtrl();
TBBUTTON tbButton;
tbButton.iBitmap = pToolBarCtrl->AddBitmap(1, IDB_MY_RUNTIME_ID);
tbButton.idCommand = MY_NEW_COMMAND;
tbButton.fsState = TBSTATE_ENABLED;
tbButton.fsStyle = TBSTYLE_BUTTON;
tbButton.dwData = NULL;
tbButton.iString = NULL;
if (tbButton.iBitmap==-1)
TRACE("I couldn't load the button image");
if (!pToolBarCtrl->InsertButton(1, &tbButton))
TRACE("I couldn't create the new button");
pToolBarCtrl->AutoSize();
}
Thanks !
PD: I use ON_COMMAND_RANGE handler, to catch the new event with my predefined ID, thanks Saurwein
|
|
|
|
|
Hello,
I'm not very familiar with all these IE COM interfaces, so it's difficult to me to find out the correct way. All I want to do is capture mouse events in my custom toolbar (e.g. mouse movements or clicks within the view of the html document). Any links & suggestions will be very appreciated.
Best regards
Best regards
/Bart
|
|
|
|