|
Suppose I want an application which takes a source file and outputs its data members and functions.
Supposed to develop into a kind of class view explorer.
Regarding parsing the source file ....
should i go for using regular expressions rules for this parsing or
should i go for a language representation in context free grammer[CFG] and use the CFG rules for parsing
or is there any other possible ideas for source file parsing
awaiting advice
fordge
|
|
|
|
|
CFG.
You could use Lex/Flex and Yacc/Bison ( ) or something like Antlr[^] ( ).
The Antlr site has several free for use grammars for different languages.
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
C++ code is hard to parse, unless you have an LL(k)-parser, IIRC. I believe ANTLR is a generalized LL(k) parser generator. But I'm unsure if there are any freely available LL(k) grammars for ISO/IEC 14882 C++.
Many class viewers do heuristic parsing, which are basically "creatively guessing" parsers. I don't think they are strict CFG parsers.
Good music: In my rosary[^]
|
|
|
|
|
I used Oscilloscope control in win32 and i always get an error while graph was plotting data
"Unhandled exception in sm85032.exe (UOPORT.DLL): 0xC0000005: Access Violation."
as i debug into the code the source of the problem was an error in freeing a "POINT" type
pointer variable in the oscilloscope header.
Would there be nay problem if i use WTL code in win32?
or is there anything i should set before accessing WTL code.
Any hints on this one.
Thanks!
|
|
|
|
|
Hi
I am writng an application in mfc which have to monitor the internet explorer
and to get the x and y coordinates of the caret position.
I already knows how to get IHTMLDocument2 from the HWND
but was not able to figure out how to get the position of the caret inside the document.
i understood that the IHTMLCaret cannot be retrieve because my application is in a different process.
So what is the solution for this
i will be very happey to hear any suggestion because i am stuck with this problem for almost two weeks
now.
|
|
|
|
|
Hi Folks,
I have a webservice written in Java successfully deployed on Tomcat 5.5.9. I have updated the server configuration file of Tomcat to support SSL communication on port 8443. After restarting the tomcat server, I am able to access the webservice also on the following URL through web-browser.
https://localhost:8443/mywebservice
As before, it is also accessible on http://localhost:8080/mywebservice.
Now, I am developing a COM client in Microsoft Visual Studio (Visual C++ 7.1) that uses this webservice. The stubs are automatically created using the tool SPROXY of Visual Studio. Everything works fine as long as I give the URL of the webservice as http://localhost:8080/mywebservice.
But, if I try to give the HTTPS URL "https://localhost:8443/mywebservice", the method invocation on the webservice fails. Infact, the call does not reach at all to the webservice. The call reaches the corresponding method in the stub file (the file generated by sproxy). In the method, it fails while executing "SendRequest" method.
While debugging, I found that SendRequest is actually routed to atlsoap.h from where it goes to "Navigate" function in atlhttp.inl. Here, it fails while executing SetDefaultURL function. The exact line where it fails is Line 2142 of atlhttp.inl, which is following:
if ( currScheme != ATL_URL_SCHEME_HTTP && !TSocketClass::SupportsScheme(currScheme) )<br />
return false;
Could anyone suggest what changes I might have to make to successfully access HTTPS URL from my COM client in the similar way I access HTTP URL ?
Thanks & Regards,
Arun Gupta
|
|
|
|
|
Have you been able to get this going? I've just looked into the issue and noted I'd have to write my own socket handler.
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Hi,
I thought I had posted this yesterday, but it doesn't seem to have gone through. Apologies if it's a repost.
I was wondering if anyone could point me to any articles or information for WTL/ATL on how to detect if my application is already running and passing any request to open files etc. to the existing instance.
Thanks in advance.
|
|
|
|
|
|
Hi,
Thanks for the quick reply, worked like a treat. Now I need to work out how to send information to another window. I can get the HWND of the instance by using ::FindWindow() but what's the Windows way of sending information to another process? i.e. If I double-click a file associated with my program I want to use the previous instance to open it.
I tried sending a WM_NOTIFY to it, but obviously it won't work since I can't send any information across.
Thanks in advance.
|
|
|
|
|
Try WM_COPYDATA
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
It worked like a treat, thanks for all the help!
|
|
|
|
|
So, my co-worker and I are converting a major library to be UNICODE compatible. Now I can see specific file streams like ifstream and wifstream that are specific to single byte strings and wide character strings.
My question is, Is there a generic file stream that will compile to the appropriate character type, depending on your settings? A bit like how TCHAR will compile as a char, or a wchar_t if in UNICODE.
If there is for the file stream, is there a generic one defined for the string class as well?
I Dream of Absolute Zero
|
|
|
|
|
|
ifstream and wifstream (like all C++ stream and string classes) are char and wchar_t variants of
basic_ifstream< CharT, CharTraits = std::char_traits< CharT > >,
where CharT is the character type and CharTraits is a specialization of std::char_traits< CharT >, or a compatible class.
Therefore, you can have:
typedef std::basic_string< TCHAR > _tstring; // TCHAR string!
typedef std::basic_ifstream< TCHAR > _tifstream; // TCHAR input file stream
class std::char_traits< Unicode >{ ... }; // pseudo-code
typedef std::basic_ifstream< Unicode > uifstream; // Unicode input file stream
or
class UnicodeTraits{ ... }; // char_traits-like class
typedef std::basic_ifstream< Unicode, UnicodeTraits > uifstream2;
Note that the file path is const char *, so this will not support wide/Unicode paths.
HTH
Reece Haston Dunn
Software Engineer, Sophos
Web: www.sophos.com
Sophos - protecting businesses against viruses and spam
|
|
|
|
|
The Createinstance method is not working properly.It does not return
the handle what is the problem ..?
DG
|
|
|
|
|
I hope it will work..
CLSID clsid;
HRESULT hr;
here u possed application with interface...
hr=CLSIDFromProgID (L"Word.Application", &clsid);
if (hr!=S_OK)
AfxMessageBox(":failed to get the clsid");
// Create an instance of the Word application and obtain the pointer
IUnknown* pUnk;
IDispatch* pDispApp=NULL;
hr = ::CoCreateInstance( clsid,
NULL,
CLSCTX_SERVER,
IID_IUnknown,
(void**) &pUnk);
// Query IUnknown to retrieve a pointer to the IDispatch interface
hr = pUnk->QueryInterface(IID_IDispatch, (void**)&pDispApp);
ASSERT(pDispApp);
Thanks,
Anji.Manchikanti
|
|
|
|
|
Hi,
Better Register Dll using Regsvr32 and then use
CoCreateInstance for creating a COM instance.
|
|
|
|
|
The Createinstance method is not working properly.It does not return
the handle what is the problem ..?
DG
|
|
|
|
|
I'm quite experienced with MFC and MFC's "templatized collections". However, I'm writing an ATL server and need to track a map of client connections. I'd like to do this via a handle (actually a GUID) that I return to successfully connected clients. Therefore the map will be Handle-To-ConnectionObj. How is this done via ATL?
|
|
|
|
|
I've not used VC++ 7 but a casual look at the Help shows that there are a number of sample applications that illustrate using the collections. I assume you're using VC++ 7?
Kevin
|
|
|
|
|
Hi,
Any one know "How to develope old db provider in vc++ by ATL" help me...
thanks
Thanks,
Anji.Manchikanti
|
|
|
|
|
I'm having a CRichEditView for a long time in my code and suddenly the backcolor when typing something in the view is black....??like a square black around each letter I'm typing??
I patched it by doing a charformat in the OninitialUpdate
CHARFORMAT2 cf2;
m_editCtrl->GetDefaultCharFormat(cf2);
cf2.dwEffects = 0;
cf2.crBackColor = ::GetSysColor(COLOR_WINDOW);
SetCharFormat (cf2);
but when I'm doing an undo the black backcolor coming back and with the letter BOLD and with the letter higher than when I setted it at star....????
I overloaded functions OneditUndo and OnEditRedo and by writing the same code.
It works but it's not really nice...
Is there anybody who had that same problem??
|
|
|
|
|
can anyone briefly explain me about .NET porting ?
What are the significant changes need to be done after porting a VB application to VB.NET?
|
|
|
|
|
ATL, WTL and STL are all template libraries in C++. Why did you ask this question here ?
Christian Graus - Microsoft MVP - C++
|
|
|
|