|
hi...
i have developed a MFC application of syntax colorising editor from the procedure given here(by using scintillawnd class and from dll SciLexer.dll),but i want to use it for my own language for which lexer is not available.
so have added a new cpp file(Lexxxx.cxx) to scitilla/src directory.
now..problem is how i have to link with this SciLexer so that it work for my own language,and how i have to rebuild SciLexer.dll .
plase any one help to solve out this problem..
i have gone through the documentation ...but i cant understand the procedure given there...please help me..
please help...thanx in advance
|
|
|
|
|
hi every one
do you know how can emplement interrupts in windows whit assembly?
|
|
|
|
|
Do you want to use assembly on c++ like this:
__asm
{
move al,2
}
|
|
|
|
|
__asm int 3;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
template<typename V>
class num
{
IMP_EXP __stdcall num() ;
IMP_EXP __stdcall ~num() ;
IMP_EXP __stdcall Print( V Val ) ;
}
template< typename V> IMP_EXP __stdcall num< V >::num()
{
}
template< typename V> IMP_EXP __stdcall num< V >::~num()
{
}
template< typename V> IMP_EXP __stdcall num< V >::Print( V Val )
{
printf( "%d" , Val ) ;
}
//// dll
i put the following code on a dll that exprts this class members.
/////exe
void main()
{
num <long> obj ;
obj.Print( 10 ) ;
}
////
i tried to import it from exe then the compiler displays error 2019 : unresolved external symbol.. this is my first template program.
one more question is this syntax are correct ?
how to solve this problem ?
plz help me
-- modified at 1:50 Thursday 2nd August, 2007
|
|
|
|
|
Seems like the template code is right.
executable can not identify the functions of dll. Did you added respective lib file Projects > Settings > Link > Object/Library modules. And include the header file and place the dll in the same path as exe.
Hope this might help
|
|
|
|
|
ive included the header file and ilb correctly. other classes imported from that dll are working .. i think the problem is exporting ..
|
|
|
|
|
I think the problem is including the template in the dll itself
A template generates code when it is instantiated. So, how are you going to put that inside the DLL?
If you are distrubuting template, write both declaration and definition in one header file, and just share it across projects. No need of dll and lib
Hope I make sense here!!!
|
|
|
|
|
|
When the CFileDialog class is created for a File Open operation, the user can double click in the list view to either select a file or change directories. Before the class processes the double click to perform one of these functions, how can I intercept this double click event?
I have tried to use a message map of ON_WM_LBUTTONDBLCLK(), but the code still never hits the CMyFileInputDlg::OnLButtonDblClk(UINT nFlags, CPoint pt) function. What am I missing?
|
|
|
|
|
To catch the event of CFileDialog, you need to create your own Class with the base class of CFileDialog.
There, you can override the event handlers or functions and can do whatever you want.
Creating your own Dialog is also a solution if your purpose is very specific.
Anurag Gandhi.
http://www.softgandhi.co.nr
|
|
|
|
|
I have actually done that, but it still does not trigger the double click event.
CMyFileInputDlg::CMyFileInputDlg(CWnd* pParent/* = NULL*/)
: CFileDialog(TRUE, NULL, NULL, OFN_EXPLORER | OFN_ENABLEHOOK | OFN_HIDEREADONLY | OFN_ENABLEINCLUDENOTIFY | OFN_SHOWHELP , NULL, pParent)
I still wish to use the base CFileDialog class.
|
|
|
|
|
from the MSDN Library "The hook procedure does not receive messages intended for the standard controls of the default dialog box. You can subclass the standard controls, but this is discouraged because it may make your application incompatible with future versions."
This means you can't do any processing in response to the double click event, without jumping through hoops that are not recommended. What you can do is provide handlers for :-
CMyFileInputDlg::OnLBSelChangedNotify
CMyFileInputDlg::OnFileNameChange
CMyFileInputDlg::OnFolderChange
CMyFileInputDlg::OnFileNameOK
|
|
|
|
|
Roger,
Thanks for this. The evidence suggests that this is what is happening. If I use the Old Style rather than Explorer style, I may catch the double click event? It still doesn't seem to work though.
|
|
|
|
|
Did you use of OFN_ENABLEHOOK and did you set lpfnHook ?
From the MSDN:
"If the OFN_EXPLORER flag is not set in the Flags member, lpfnHook is a pointer to an OFNHookProcOldStyle hook procedure that receives messages intended for the dialog box"
|
|
|
|
|
Yes, I did. I have the OFN_EXPLORER flag set, but all I was getting was the WM_NOTIFY message. This message doesn't notify of a double click, rather whether a file was selected, or a folder. I need the double click event.
|
|
|
|
|
I was working and searching for your question but I couldnt find an answer for it for example on this[^] thread someone asked like your question and it seems that he got an answer but I couldnt work with that answer.
|
|
|
|
|
I have to expose a BYTE pointer from activex control to exe. but I am not able to do that .can anyone help me.
S.Yamini
|
|
|
|
|
How many BYTES does the host executable need to access? The safe 'COM way' of doing this (if there are only a few bytes) might look something like this:
SAFEARRAY *pArrayVal = pdispparams->rgvarg[0].parray;<br />
<br />
if(NULL != pArrayVal && 0 < pArrayVal->rgsabound[0].cElements)<br />
{<br />
BYTE *pBytes = new BYTE[pArrayVal->rgsabound[0].cElements];<br />
<br />
if(NULL != pBytes)<br />
{<br />
char HUGEP *pArray = NULL;<br />
HRESULT hr = SafeArrayAccessData(pArrayVal, (void HUGEP * FAR *)&pArray );<br />
<br />
if (SUCCEEDED(hr))<br />
{<br />
memcpy(pBytes, pArray, pArrayVal->rgsabound[0].cElements);<br />
SafeArrayUnaccessData(pArrayVal);<br />
m_owner->FireEvent(pdispparams->rgvarg[1].lVal,pBytes,pdispparams->rgvarg[1].lVal,pArrayVal->rgsabound[0].cElements,1);<br />
}<br />
}<br />
delete[] pBytes;<br />
}
Essentially, you would send a copy of the bytes. If there is a very large amount of bytes to be copied or high performance was required then this method would be inferior.
Hope this helps,
-Randor (David Delaune)
|
|
|
|
|
Is creating a PCH file out of C header the answer to including a C header in C++ code?????
thankx
|
|
|
|
|
You can include a "C header" the same way you include any header file.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Let me ellobrate the Header is from the first project out of s 2 project solution
I sm getting all kinds of problem including this in my second project since it is depdent on other headers in the first project
This goes back to a question I posted on carrying over #define from the first project into the second
Maybe the answer to my problem is building a pch from this header in the first project and then just including it in the project??
thankx
|
|
|
|
|
Besides needing a path to the header file in a different project directory, I can't see why
there should be anything different.
What are the problems that are occurring?
I personally use separate folder(s) for any header files that will be shared between projects.
Then in my #includes, I do something like
#include "..\commonheaders\header.h"
The fact that they're "C" headers shouldn't matter. The Windows headers are C.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
The first project was orignally developed under Linux so.... its a pure makefile project it has a buch of #define('s) for cygwin and other platform('s) etc...
When I include one of the headers in My project were I am trying to add code to my project a C++ MFC project I get a whle buch of complie errror(s) I figure while building the first project which contains this header that I trying to use I could compile it as a .pch (I think of a .pch as compling and linking a load module.. I am a Mainframe programmer and I am creating this add on project to try and teach myself C++ MFC or .NET)
Anyway I think of a .pch as compiled and linked load module ( I think that this is what the concept of .pch is about ???)
If I dont understand what the porpose of .pch is if you could enlighten me I would apperciate it ...
Thankx
|
|
|
|
|
I think the idea you have of using a .pch from one project in another project is not a good one.
If you cant or dont want to change the C header such that it looks like this
#ifdef __cplusplus
extern "C" {
#endif
lots of C stuff etc
#ifdef __cplusplus
}
#endif
then I cant see why using this in your C++ project wouldnt work
extern "C" {
#include "myCheader.h"
}
it essentially achieves the same end result after precompilation.
|
|
|
|