|
hello everybody,
my project module is to develop a graphical language in vc++. we have to declare a few keywords,graphical routines,looping statements etc.
Using the syntax that we declared earlier, telling the user to follow that syntax to code it.
My problem is, how can i define these langauage primitives and compile it to produce the output.
FOr example,
the user code in editor,
# start
text "Mahe" 123 232 Bold
cirlce 232 232 21
line 232 232 232 121
# stop
our compiler(VC++) has to read all this code and produce a graphical output.please guide me for , how to analyze this project.
first i have to spec it out the language keywords etc and all...please suggest me to workout this project
Mahesh Kumar,b'lore
|
|
|
|
|
Hello!
If grammar in your language is simple
You must learn about(as minimal) regular expression:
http://www.codeproject.com/cpp/OwnRegExpressionsParser.asp
if grammar in your language is difficult(above 50 grammar rules), you must learn compiler design theory and use compiler-of-compiler for example yacc.
|
|
|
|
|
I know this may be an easy beginner question but it drives me crazy and I've alredy spent 3 hours on this.
I added the followilng libs to the linker:
d3dxof.lib
dxguid.lib
d3dx9dt.lib
d3d9.lib
comctl32.lib
winmm.lib
and the included files:
#include "./Common/d3dfont.h"
#include <windows.h>
#include <d3dx9.h>
#include <stdio.h>
Now I'd like to create a global font:
static CD3DFont* Font1 = new CD3DFont(_T("Arial"), 20, D3DFONT_BOLD);
static CD3DFont* Font2 = new CD3DFont(_T("Arial"), 10, D3DFONT_BOLD);
when I compile the whole thing the linker gives me an LNK2019 error, unresolved external symbol.
I think I've had the same error when I first used a dx-function, but I could solve the problem with the right lib-file.
I searched through the Text3D-example of the sdk but I can't find the point my project file is missing
|
|
|
|
|
This link[^] could help you.
And IMHO, global variables suck!
In amongst the statues
Stare at nothing in
The garden moves...
|
|
|
|
|
I've made a Speech application with Visual C++ and I want to run it in other pc but when I do, I get an error message with initializating speech engine. Must I export some else other files (I've only exported .exe file) so I can run the .exe file in other pc's different from where I compile and debug the applications?
Thank you in advance!
I have no idea
|
|
|
|
|
hi,
open your exe with "dependency walker". Now you can see which files (dll, sys,...) your exe needs to run.
Paul
|
|
|
|
|
Thank you
|
|
|
|
|
In the past I used a speech SDK from Microsoft and in the documents it lists the modules that you need to include in your install program.. I don't remember any specifics (was quite a while ago), just thought you may have over looked that..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Yes, thanks. I installed all that modules but it doesn't work... I think it's about some trouble of software
|
|
|
|
|
Hi!
My program joining a multicast group and recieves packets. But I will recieve the packets at the network device, so there will be no delays when it is placed in a queue at my computer.
Does anyone know how listening at the device in c++?
I'm using linux mandrake.
Thanks for your help,
Stefan
|
|
|
|
|
|
I am using tree view control in order to enumerate all the application with window. I am using CreateWindowEx to create window to obtain the handle.Presently my output is very similar to that of Spy++ . But what I want window from CreateWindow should be hidden (a/c to requirment). nOT GETTING ANY WAY TO DO IT.
|
|
|
|
|
I want to print bitmap on full page, so i wright:
[code]
void CtestView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
int cxPage = pDC->GetDeviceCaps(HORZRES);
int cyPage = pDC->GetDeviceCaps(VERTRES);
Graphics g(pDC->m_hDC);
g.DrawImage(m_pBitmap, 0, 0, cxPage , cyPage );
}
[/code]
Thats ok in preview but not in printer. What transformations i need to do?
|
|
|
|
|
This is due to a printer DC and a screen DC having different levels of support. Take a look at my "Printing tips and tricks from the trenches" article in the printing section. It has a method to solve this problem.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
I read that article, but it dont contain answer: What and how i need to transform to see preview and printing page in the same style, using GUI+ ...
|
|
|
|
|
You need to make use of the procedure that changes a DDB to a DIB and use StretchDIBBits() to plot it. This command is much better supported by printer DC's. BitBlt usually fails miserably.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
I use GUI+, object Graphics and Bitmap. No BitBlt or StretchDIBBits!
|
|
|
|
|
Here is answer if somebody whant in:
void CtestView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
int cxPage = pDC->GetDeviceCaps(HORZRES);
int cyPage = pDC->GetDeviceCaps(VERTRES);
Graphics g(pDC->m_hDC);
g.SetPageUnit(UnitInch);
g.DrawImage(m_pBitmap, 0, 0, cxPage/g.GetDpiX() , cyPage/g.GetDpiX() );
}
|
|
|
|
|
Hi,
In a thread function exception is occured. exception in CInternetException. while throwing exception the thread is terminated with value 0. any one help to me.
Thanks in Advance.
Have A Nice Day!
Murali.M
|
|
|
|
|
Hello!
Try using catch(...) statement to prevent system exception handling.
UINT MyThreadFunc(LPVOID pArg)
{
try {
// code which cause an exception
}
catch(...)
{
// empty or your own handling code
}
}
|
|
|
|
|
<br />
<br />
CMyClass::OnExecute()<br />
{<br />
AfxBeginThread(myThreadCaller,NULL)<br />
}<br />
<br />
UINT myThreadCaller(LPVOID p)<br />
{<br />
try<br />
{<br />
ActualFunctionThatThrowsException();<br />
}<br />
catch(..)<br />
{<br />
}<br />
}<br />
ActualFunctionThatThrowsException()<br />
{<br />
}<br />
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
Can anyone help me find what's wrong with operator() overload pls?
#include <iostream>
using namespace std;
class A
{
public:
int value;
A(int a) : value(a) {}
operator int()
{
return value;
}
void operator ++ () // prefix
{
value = value+1;
}
};
int main()
{
A a1(27);
++a1; // this works fine...
// the following does not...MSVC6 tells me "error C2064: term does not evaluate to a function"
cout << "value:" << a1() << endl;
return 0;
}
Any ideas?! Many thanks...!
Chris
|
|
|
|
|
yeah there is one idea ...
try this
cout<<"value:"<< a1.operator int()<< endl ;
> in place of ur line cout << "value:" << a1() << endl;
actually u have overloaded int() operator
Abhishek Srivastava
Software Engineer (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
I see...but how do I overload the () operator if i need to use it like this in my code:
cout << "value: " << a1() << endl;
Chris
|
|
|
|
|
operator()()
Lets be honest, isn't it amazing how many truly stupid people you meet during the course of the day. Carry around a pad and pencil, you'll have twenty or thirty names by the end of the day - George Carlin
Awasu 1.2 [^]: A free RSS reader with support for Code Project.
|
|
|
|