|
Your list is terrific, but in most situations scripting languages don't cover 3) as well as you might like. The most common approach is to code as much as you can in the scripting language, and only then if profiling shows that performance is insufficient, add a hook to optimised code written in C/C++ or dare I even say it, FORTRAN if required. Both Python and Lua meet all these requirements and both can be compiled to byte code.
You're also missing a few things fromt he list.
6) It needs to be easy to use (client usability)
7) It needs to be easy to integrate (programming perspective)
8) It needs to be easy to extend
The easiest way to achieve 6) is to use a language which most people already know or can learn very quickly. Custom languages or very small parsers / languages might have some quirks that take a while to work out
7) and 8) go hand-in-hand, and I would recommend picking a language on how easy it is to use, integrate and extend from the programmers perspective as well as the clients. Writing and maintaining language bindings is not the type of code that you'll want to write every day.
There are two major classes of bindings to languages at the moment - as a precompilation step (SWIG) or as part of the compilation (boost::python and luabind). My personal preference if for the later, because it guarantees that your bindings are always upto date.
http://www.lua.org/[^]
http://luabind.sourceforge.net/[^]
http://www.python.org/[^]
http://www.boost.org/libs/python/doc/index.html[^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Great suggestions! I looked into LUA and I think it will do all that I want - and more. It looks pretty well written and organized and it is always a bonus when I can learn from others.
|
|
|
|
|
Hi,
sounds easy, but it's very complicated...
I want to have a custom drawn TreeView with multiline items. The drawing of the tree works perfect but when the EditBox to edit the items text (TVN_BEGINLABELEDIT you know) is created it is - of course - singlelined.
Now I wanted to make it multiline and therefore I tried to use ModifyStyle but it didn't succeed.
The next approach was to create a CBT-Hook to hook the creation of the Edit and "smuggle" the ES_MULTILINE-Style into the windowstyle but strangely this also didn't succeed. Do you have any suggestions? the CBT-Hook is definitely called (I verified this with TRACE and Spy++).
Here's the HookProc-Code (hTree is the HWND of the tree):
LRESULT CALLBACK HookCreateWindow (int nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode == HCBT_CREATEWND) {
CBT_CREATEWND* pCWnd = (CBT_CREATEWND*) lParam;
if (pCWnd->lpcs->hwndParent == hTree) {
pCWnd->lpcs->style |= ES_MULTILINE;
TRACE("\nEdit_created. HWND: 0x%x", (HWND) wParam);
}
}
return CallNextHookEx(g_hHook, nCode, wParam, lParam);
}
Thanks for your answers!
|
|
|
|
|
How are you planning on ending that editbox? Those labeledits are either aborted with esc or accepted by pressing enter. A multiline labeledit would instead create an extra line when the user hits enter. I suspect this is the reason the control is refusing to become multiline. A solution would be to overload the F2-key and pop up your own dialog with a multiline edit box, a OK button and a Cancel button.
|
|
|
|
|
You can end it with clicking outside the edit on a treeview-item (done by the treeview-control). it's a normal editbox and therefore i should be able to change the style BEFORE it receives the first message (WM_CREATE). and i don't want your solution with the dialog, i don't think that's nice :/
|
|
|
|
|
Hello all
Can any one please explain me the difference between thread and a fiber? In what circumstances we should go for a fiber? Please give me some sample code or point to URL where I can get the same.
Thanks for your help.
Hari.
|
|
|
|
|
From MSDN:
A fiber is a unit of execution that must be manually scheduled by the application. Fibers run in the context of the threads that schedule them. Each thread can schedule multiple fibers. In general, fibers do not provide advantages over a well-designed multithreaded application. Fibers are not preemptively scheduled.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Is there an API available to check if a filename is valid. At the moment the only information I can find is in the help for CreateFile() where it gives a list of invalid characters and filenames such as ./?\* or com1,con,lpt.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
try/catch opening the file with specified filename?
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hello!
if you only check the string of the filename,you can check if the string have the list of "./?;'".
if you check whether the file is existent, you can use code as follow in VC6.0 :
BOOL CheckIfFileExists (LPCTSTR szFileName)
{
ASSERT( szFileName != NULL );
if( _tcslen(szFileName) == 0 ) return FALSE;
DWORD dwAttr = GetFileAttributes(szFileName);
if( dwAttr == 0xFFFFFFFF ) return FALSE;
return (dwAttr & FILE_ATTRIBUTE_DIRECTORY) == 0;
}
dupengfei
|
|
|
|
|
Question #1 : pls some give me some good pointer to smart card api's. i need them urgently or some sample project using Smart Card apis
Question #2: i am unable to use or rather say understand RegisterWindowMessage() api's.Any body pls gice me some pointer towrad it also.
thanks a lot in advance
I Think It will Work
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Alok the programmer wrote:
Question #2: i am unable to use or rather say understand RegisterWindowMessage() api's.Any body pls gice me some pointer towrad it also.
Here is some explaination from one of expert:
The RegisterWindowMessage function defines a new window message
that is guaranteed to be unique throughout the system.
So with that in minde this is one example of how to use this
special message.
If I have this code in one of my applications:
<br />
LRESULT CALLBACK MyWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)<br />
{<br />
LRESULT Result;<br />
<br />
static UINT my_message = RegisterWindowMessage("my_message");<br />
<br />
if (msg == my_message)<br />
{<br />
MessageBox(hwnd, "Someone sent me my_message", "Message", MB_OK);<br />
return 0;<br />
}<br />
<br />
....<br />
<br />
return Result;<br />
}<br />
I could talk to that application from my second application
using the following code:
// Use FindWindow, EnumWindows and EnumChildWindows to get
// the hwnd of the other application
hwnd = getting_other_hwnd_left_as_excersise_function();
UINT my_message = RegisterWindowMessage("my_message");
//-- post the hwnd the special message
::PostMessage(hwnd, my_message, 0, 0);
You could also do this:
//-- broad cast a special message
::PostMessage(HWND_BROADCAST, my_message, 0, 0);
but in this case you would need to trap the message in the
second application using the following code instead:
<br />
while (GetMessage(&msg, (HWND) NULL, 0, 0)) <br />
{<br />
if (msg == my_message)<br />
{<br />
MessageBox(hwnd, "Someone sent me my_message", "Message", MB_OK);<br />
}<br />
else<br />
{<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
}<br />
Jussi Jumppanen
Author of: Zeus for Windows, Win32 (Brief, WordStar, Emacs) Text Editor
"The C/C++, Java, HTML, Pascal, Cobol, Fortran programmer's text editor"
Home Page: http://www.zeusedit.com
Hope this will help you.
Regards
Abhishake
|
|
|
|
|
thanks abishek
but i am still not successful in doing this.
could you pls send me the sample project for both application at email address cocokola@rediffmail.com
thanks a lot
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
When using SendMessage() and PostMessage() , the ID of the message has historically been based on WM_USER , with newer applications starting to use WM_APP . While this certainly works, the possibnility exists for two applications (DLLs, actually) to send the same message, resulting in undesired behavior. Using WM_USER or WM_APP with SendMessageToDescendents() is also asking for trouble. The solution, therefore, is to use a registered message. It is guaranteed to be unique. The message only means something to the window that created it and the target window.
Read this article for more.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thanks for wonderful article,my problem solved.
have you any idea abt SmartCard api's sir
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Alok the programmer wrote:
have you any idea abt SmartCard api's sir
No.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi Alok,
I don't have sample project. but take a look (if you have'nt before)at the example which is using RegisterWindowMessage() function. Here
Hope this help
Regards
Abhishake
|
|
|
|
|
thanks yaar
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi All,
When some embeds the ATL ActiveX Control in the web page like
<object id="MyID" classid="CLSID: 9698F21D-F7A3-4968-B80C-850BEE451D3C" align="CENTER” height =" 100%"="" width="100%">
How the control creation and initialization is done internally.
Thanks in advance,
Abhi Lahare
|
|
|
|
|
I write an installer using Visual Studio Installer
for VC++ 6 application.
but i want an interface as some installer have totaly Blue n maximized backgroud .
and aslo need a setup file
innstaller only make a msi file ..
2 :: During installation with installer msi file
it gives the eror on Client
that Failed to register MFC42D.dll .. i m copying MFCO42D.dll , MFC42D.dll and MSVCRTD.DLL on client
y it is giving this error
thanx
|
|
|
|
|
HI,
How can i forcly Minimize the Dialog.
For Example if user do some thing illegle
then i want to minimze hte dialog.
any idea
thanx
|
|
|
|
|
ShowWindow(SW_MINIMIZE);
more values:
SW_FORCEMINIMIZE
Windows 2000/XP: Minimizes a window, even if the thread that owns the window is hung. This flag should only be used when minimizing windows from a different thread.
SW_HIDE
Hides the window and activates another window.
SW_MAXIMIZE
Maximizes the specified window.
SW_MINIMIZE
Minimizes the specified window and activates the next top-level window in the Z order.
SW_RESTORE
Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
SW_SHOW
Activates the window and displays it in its current size and position.
SW_SHOWDEFAULT
Sets the show state based on the SW_ value specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application.
SW_SHOWMAXIMIZED
Activates the window and displays it as a maximized window.
SW_SHOWMINIMIZED
Activates the window and displays it as a minimized window.
SW_SHOWMINNOACTIVE
Displays the window as a minimized window. This value is similar to SW_SHOWMINIMIZED, except the window is not activated.
SW_SHOWNA
Displays the window in its current size and position. This value is similar to SW_SHOW, except the window is not activated.
SW_SHOWNOACTIVATE
Displays a window in its most recent size and position. This value is similar to SW_SHOWNORMAL, except the window is not actived.
SW_SHOWNORMAL
Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
hope this helps
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I want to create a ISAPI so that when a visitor click a specific link to require for a specific page, the ISAPI can get the result which is processed by IIS, and modify this result , then send this result to the client.Can you help me?Thanks
|
|
|
|
|
sorry for asking a very elementary question but i m
new to VC++
Can there be a messagebox without any buttons??
green_trees
|
|
|
|
|
I think not from MessageBox API...You can create your own dialog and control it via DoModal and EndDialog and have the appearance look of a MessageBox...
|
|
|
|