|
Given the files below I am getting multiple errors . I think I need a point.cpp and a main driver, having a hard time tying it all together
is there a way to upload files instead of pasting all the code in 6+ files? soemone let me know please
Thanks
|
|
|
|
|
Yes
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
|
carefully
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi,
How can I know from where an executable file is loaded?
After compilation, the executable fill will be saved in somewhere,
how can I know it's location when the file is executed.
For example, if the file is C:\myfile\test.exe, I want to print out C:\myfile when test.exe is run, if the file is moved to C:\another-folder\test.exe, I want to print out c:\another-folder when it is executed.
Thanks a lot!
George
|
|
|
|
|
GetModuleFileName()
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
|
|
How to build MFC libs, so I can debug inside MFC code.
Agha Khan
|
|
|
|
|
I wanted to make a look something like this:
_________________
|************|**|
|************|**|
_________________ <- I can't get this splitter bar
|***************| (m_splitterWnd) to his right position
_________________ I've set the sizes right, but it doesn't work
The strange thing is that if I change the layout to:
____________________
|*****************|
___________________
|**************|**|
|**************|**|
____________________
it works... why?
Try to explain this code...
<br />
RECT clientRect;<br />
GetClientRect(&clientRect);<br />
int iHeight = clientRect.bottom - clientRect.top,<br />
iWidth = clientRect.right - clientRect.left;<br />
<br />
<br />
m_wndSplitter.CreateStatic(this, 2, 1, WS_CHILD | WS_VISIBLE, AFX_IDW_PANE_FIRST);<br />
m_wndSplitter1.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE,<br />
m_wndSplitter.IdFromRowCol(0,0));<br />
m_wndSplitter1.CreateView(0, 0, RUNTIME_CLASS(CEditView),<br />
CSize((int)(iWidth * 0.8), (int)(iHeight * 0.7)), pContext);<br />
m_wndSplitter1.CreateView(0, 1, RUNTIME_CLASS(CEditView),<br />
CSize((int)(iWidth * 0.2), (int)(iHeight * 0.7)), pContext);<br />
m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CEditView),<br />
CSize(iWidth, (int)(iHeight*0.3)), pContext);<br />
Thanx... any help will be appreciated
..:: a l i e n ::..
|
|
|
|
|
Hello people,
I urgently need to look at a piece of code for checking whether the brackets AND braces of an algebraic expression are nested. I've been trying to write it for a couple of days, but I still cannot get it to work, too many nested loops for my level. If you have the time, can you look and tell me whats wrong with my code? If not, I think if I look at a correctly working one, it would help. Thanks in advance,
timepanicked
#include <iostream>
#include <fstream>
#include <string>
#include <string.h>
using namespace std;
int red_checker(string a, int size, int l, int open_curr, int closed_curr, int diff_open, int diff_closed)
{
int e=l, f,x, d, b, r, n,c;
while (l>0)
{
cout<<"while # 0"<<endl;
while="" (="" a[l]="" !="open_curr)" looks="" for="" open="" sign="" under="" current="" inspection
=""
="" {
="" cout<<"while#1"<<endl;="" l--;
="" }
="" if="" (l="=0)" reached="" beginning="" of="" array
="" {="" and="" opening="" not="" found=""
="" (n="0;" n<size;="" n++)
="" cout<<"for#1"<<endl;
="" closed_curr)="" but="" closing="" return="" 2;="" 2--=""> not nested
}
return (red_checker(a,size,e,diff_open,diff_closed,open_curr,closed_curr));
//call funct to check other bracket type
}
for (f=l+1; f<size-2, a[f]!="closed_curr;" f++)="" check="" array="" after="" open="" sign="" to="" find=""
="" {
="" cout<<"for="" #2"<<endl;
="" }="" if="" a="" closed="" one="" matches="" it
="" (a[f]!="closed_curr)" not="" found
="" return="" 2;
="" else="" (a[f]="=" closed_curr)
="" {
=""
="" for(b="l+1;" b<f;="" b++)="" now="" see="" there="" is="" the="" other="" bracket="" type="" in-between...
="" #3"<<endl;
="" (a[b]="=diff_closed)
" 2;
="" #4\n";="" for="" (c="b+1;" c<f;="" c++)="" ...and="" it="" nested
="" (a[c]="=" diff_closed)
="" a[c]="a[b]=0;
" break;
="" }
="" }
="" a[l]="0;" a[f]="0;
" cout<<"we="" set="" and="" "<<a[f]<<a[l]<<endl;
="" }
="" }
}
int="" main="" ()="" {
string="" a;
int="" v="0," z="0," l,="" j,="" size;
ifstream="" greenstream;
="" greenstream.open("greenfile.cpp");
="" greenstream="">>a;
greenstream.close();
size = a.length();
l=size-1;
v = red_checker (a, size, l, '(', ')', '{', '}' );
z = red_checker (a, size, l, '{', '}', '(', ')' );
if (v==2 || z==2)
cout<<"Input in greenfile is not nested"<
|
|
|
|
|
For starters:
Anonymous wrote:
int e=l, f,x, d, b, r, n,c;
You need to do this in C. In C++, it's much better to declare your variables as you use them, and certainly to give them an initial value. My first suspicion was an uninitialised variable from this list, but the function is too long for me to bother trawling through for variables that have random values from the top of the function.
Anonymous wrote:
string a;
int v=0, z=0, l, j, size;
ifstream greenstream;
greenstream.open("greenfile.cpp");
greenstream>>a;
This will read the file until the first whitespace character into the string. It won't read in the entire file.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I am connecting to a remote SQL Server in my software. Its all working fine.. but on some PCs it gives exception and connection is not made. What are strict requirements for connecting to a remote SQL Server. My SQL Server uses SQL Server based authentication.. I heard that Win XP machine cant conenct to SQL Server if there is no password of Win XP machine.. plz tell me strict requiremnts
Thanks
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
|
I have been given a rather unfortunate assignment at work:
I have to look into what it would take to put a COM wrapper around a small multi-threaded C++ API that I wrote. It seems a client is interested in the API if it can support VB. I have the option of telling my boss it's impossible and that he should tell them to toss off. My assumptions are that they are using VB6.
I've done ATL before but never in wrapping a multithreaded API that had to work in VB. Any suggestions? Besides the obvious that all the com objects need to be dual interface (IDispatch), is there any thing funky I need to do to handle the fact that the lib uses multiple threads internally?
Basically the VB client would do nothing more than
- create the app instance (the app would house my library)
- init the app (App.Init or something like that)
- run it (App.Run)
- respond to events
The VB client has no need to work in multiple threads, or be aware of their presence.
Any suggestions would be *most* appreciated!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Jim Crafton wrote:
The VB client has no need to work in multiple threads, or be aware of their presence.
You will need to be careful how your events are passed to the VB client. It may expect or require that callbacks to it are on the GUI thread.
It's probably not the right way to do it when using COM (all that apartment stuff comes to mind), but I've used the 'hidden window and user-defined messages' trick to handle this. In the GUI thread, create a hidden window. Your event handler, which is called on an unknown thread, uses ::PostMessage and the window's handle to drop a message into the hidden window. The hidden window, running on the GUI thread, processes the user-defined message and handles the event. If the event has information, you can use the WPARAM and LPARAM arguments for small things, or pass pointers to objects allocated from the heap. If you do the latter, you need to ensure that the hidden window has a WM_DESTROY handler that will run the message pump dry via PeekMessage and delete the arguments.
The event handler and the GUI thread are decoupled in this case, which can be useful. The event handler doesn't block (except briefly during the PostMessage call). Events are maintained in order by the hidden window message queue.
Software Zen: delete this;
|
|
|
|
|
I've tried to make an Idle time processing in an MDI project, but even if there are no messeges for the window the lCount doesn't go higher then 1... => I've tried to see what's going on in the thCore, but I couldn't figure'it out.
Any tip would be appreciated.
10x
..:: a l i e n ::..
|
|
|
|
|
CWinApp::OnIdle will return FALSE when it is done. If you want to insert idle processing after that, you have to get your override to return TRUE. If it returns TRUE, OnIdle() will be called with an increased lCount.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Can anyone assist with a template or code for stacks and ques?? I have been thrown into a class with little foundation, so any help is appreciated.
Hi_Pdale Here
|
|
|
|
|
these are the standard C++ container :
#include <list>
#include <vector>
#include <queue>
all these are from the std:: namespace.
you can also read The C++ language from Bjarne Stroustrup for more infos.
TOXCCT >>> GEII power
|
|
|
|
|
If you just want a way to store a collection an easy place to get started is indeed std::vector or std::list. If you *specifically* are looking for a stack/queue behaviour, then take a look at std::deque
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
|
I am having a tough time getting maskededit control to display any Alphanumeric text in C++. I have used maskededit control in VB with no problem. I need some help.....
|
|
|
|
|
C++NewBe wrote:
I am having a tough time getting maskededit control...
Which one? VC++ does not have a built-in one (i.e., comctl32.dll).
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Yes it does not but you can insert it in the project using "Insert ActiveX Control" and select "Microsoft Masked Edit Control, version 6.0".
|
|
|
|
|
Of course. It's not quite built-in as it is an external ActiveX control, but a masked edit control nonetheless. What specific problem are you having with it? You indicated that alphanumeric text was troubling you. Does that imply that alpha-only and numeric-only are working fine? I'm just trying to narrow down if it's a specific usage of the control that's the problem, or the control as a whole. What mask/format are you trying to use?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|