|
|
i was able to download a sentence parser created in c++, visual studio 6. but i need to run it in .net, how can i convert this vs6 application into a vs.net application, without any errors?
does anyone here have a sentence parser done in vb.net or c++.net?
thanks for your replies
|
|
|
|
|
You import it into VS7, and if it fails to compile, then it's not standard C++, so fix it.
jedskie_a wrote:
does anyone here have a sentence parser done in vb.net or c++.net?
I assume this means you want managed C++ ? Otherwise, why would you care about VB.NET ? I believe you can make your app managed with just one compiler switch, but I've never touched MC++.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
oh... yup.. thats it.. managed c++.. we need to build a dialog based search engine filter tool.. so we need a sentence parser with POS which we can use for our nlu...
|
|
|
|
|
OK, well, I believe you're a command line switch away, but I'm not sure what it is, you'd have to check MSDN.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
OK, well, I believe you're a command line switch away, but I'm not sure what it is, you'd have to check MSDN.
FYI, it's /clr
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello,
I am developing a Matlab program in which i need to use a DLL Library.
The DLL Library has 8 functions which inputs i know.
The DLL livrary is compatible with C++, C, Pascal and Visual Basic.
To use the DLL in Matlab I need to create a header file.
The problem is that I haven't work with C for some years and I am completly lost.
Can someone help me out or just put me in the right direction?
The Matlab part i am able to do but the C part I am having huge problems.
I have a Help File which include some code examples of each function declaration and its usage.
I post it here. Probably it is the best way to show what I have.
Declaration:
extern _declspec(dllimport) int WINAPI ISTCalc(double Var1, double Var2, double Var3, double *Var4, int Var5, int *Var6, int Var7);
The C Code Example of how to use it (include in the Help File):
// Variables declaration
double *newVar1, *Var4, Var2, Var3 ;
int Var5, newVar2, *Var6, newVar3, i, Var7 ;
// Get the Address of newVar2 and Give Values
Var6 = &newVar2
Var2 = 20 ;
Var3 = 40 ;
// Allocate RAM for Input and Output. Array Size = 100
newVar1 = (double *) GlobalAllocPTR(GHND, sizeof(double) * 100) ;
Var4 = (double *) GlobalAllocPTR(GHND, sizeof(double) * 100) ;
// Here newVar1 should get data from disk or other source
// Clear deallocation flag and initiaçize series identification to 0
Var5 = newVar2 = 0;
// Loop through data, calling ISTCalc on each element, and store results
for(i=0; 1<100;i++)
{
// determine if Var7 = 1 or 0 according to its definition
newVar3 = ISTCalc( *(newVar1+i), Var2, Var3, (Var4+i), Var5, Var6, Var7);
if(newVar3 != 0)
MyErrorHandlerFunction()
}
// Done processing. Deallocate DLL RAM. Check for any errors.
// When deallocating, if it is OK then replace the ouptut pointer with 0.
Var5 = 1 ;
if(newVar3 != 0)
MyErrorHandlerFunction()
}
// Use Output data and deallocate RAM at newVar1 and Var4.
Thank You Very Much,
MShapper
|
|
|
|
|
Does anyone know how to find a local group's permissions? I am enumerating through the local groups on my machine using the NetLocalGroupEnum API, but when I check the group using the NetLocalGroupGetInfo API, I only get two pieces of information that I don't need:
1 The group's name - already have, don't need again
2 The group's description - doesn't serve my purpose
Are there any APIs or methods that I can use to find if a local group is an admin group? Do I need to pull out the SID for the group and do anything with it? Could anyone even point me in the right direction?
|
|
|
|
|
This is just a guess, but I'm thinking that GetSidIdentifierAuthority() might be required.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
is there a function which can change hex string to int value?
atoi() can chage dec string to int value,
i.e. atoi("12") is int 12.
which function can change hex string, such as "AF" and "1D" to int value 0xAF and 0x1D?
includeh10
|
|
|
|
|
strtol("15AF", NULL, 16); //this uses base 16 and returns a long. the "NULL" in the middle returns the location of where it stopped parsing if you give it a valid pointer instead of NULL.
-- Rocky Dean Pulley
|
|
|
|
|
How a number is stored internally and how it is represented in code are two different things. To convert between bases, see rocky's reply.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I'm trying to figure out how to get the Device Context for a Direct3D 8.0 Backbuffer so that I can run a few GDI calls to the Backbuffer before Presenting it for display. There is a GetDC function supported in DirectX 9.0, but it doesn't go back to 8.0
Is there a backdoor way to get (or create) a backbuffer Device Context that won't impact rendering speed?
Thanks in advance
Bob Ciora
|
|
|
|
|
I have problems displaying an ATL Window (CDialogImpl-derived) in an ATL component that has "MFC support" enabled.
Tracing into the calls:
The Atl Dialog Box function finds a respective resource (it's looking for two, and picks one). DialogBoxIndirect does nothing, returns -1, but sets the last error to 0 (it DOES modify it! ).
The dialog class comes from a header that works in other ATL components (without MFC support). I added the resource to the project (include in the resource file).
Any ideas?
I never really know a killer from a savior boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
I know there is a reasonable explination behind what is going on here, but I can't figure it out.
I create a pointer, pass it into a method and when the method returns, the value of the pointer is NULL. If I trace the method call, there is a valid pointer all the way until GetNextApproach returns.
Any ideas?
CApproach* approach = NULL;
GetNextApproach(approach);
// approach is NULL here
-Kevin Shaffer
kshaff03@yahoo.com
|
|
|
|
|
That's how function parameters work. Any changes that GetNextApproach() makes to its parameter are not reflected in the caller. Make the parameter a reference (CApproach*& ) to have the caller see the change.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
try something like :
GetNextApproach( CApproach** p)<br />
{<br />
*p = new CApproach;<br />
}<br />
<br />
CApproach* approach = NULL;<br />
GetNextApproach(&approach);
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Why should it not be null? That's what you set it at. Passing the address of the pointer can make it modify it but just passing the pointer itself won't modify it. Let me explain.
See the code and the two functions below. Since you are not giving the address of the pointer to the first one, the pointer is not changing from null, it is only valid inside of your function.
char *sz = NULL;
func1(sz);
//sz is still null here.
func2(&sz);
//ok now sz is changed.
func1(char *sz)
{
sz = new char[1024];
strcpy(sz, "blah");
}
func2(char **sz)
{
*sz = new char[1024];
strcpy(*sz, "blah");
}
This is probably what you want your code to do:
CApproach approach; //notice, not a pointer.
GetNextApproach(&approach);
-- Rocky Dean Pulley
|
|
|
|
|
Ok, I think I am understanding now.
This is valid because the function is changing the contents of where the pointer I am passing in points to, not the actual value of the pointer itself.
char g_code[APP_AIRPORT_CODE_SIZE + 1];
GetCode(g_code);
GetCode(char* code)
{
strcpy(code, "Code");
}
However this does not work as I expected because I am trying to change the actual value of the pointer g_code:
char* g_code;
GetCode(g_code)
{
g_code = GetPointerToArraysomeOtherPlace();
}
Please let me know if I am still in la la land.
Thank you for your answers.
Kevin Shaffer
kshaff03@msn.com
|
|
|
|
|
rocky_pulley wrote:
This is probably what you want your code to do:
CApproach approach; //notice, not a pointer.
GetNextApproach(&approach);
Yes, except I don't want to make a copy, I just want to reference an object that is already created.
I also want to know, if I did the following, this would create a memory leak, right?
CApproach approach;
GetNextApproach(&approach);
GetNextApproach(CApproach* approach)
{
approach = GetAddressOfApproachSomePlaceElse();
}
Kevin Shaffer
kshaff03@msn.com
|
|
|
|
|
it's not a copy, he passing approach by reference.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
If, GetAddressOfApproachSomePlaceElse() calls new, then yes, this would be a memory leak. If in your function you want to change what object a pointer points to (not the object itself, but what object it points to), then one technique is to pass it a pointer to a pointer.
CApproach* pApproach = NULL;
GetNextApproach(&pApproach)
void GetNextApproach(CApproach** ppApproach)
{
*ppApproach = GetAddressOfApproachSomePlaceElse();
}
If you simply pass it a pointer, then it makes a copy of the pointer (not a copy of the object, but a copy of the pointer to the object). Any changes you make to the pointer (not the object, but the pointer to the object) will not be kept when the function returns, they are thrown away with the copy of the pointer.
Hope this helps,
Tim
|
|
|
|
|
The correct approach would be:
CApproach* approach = GetNextApproach();
The other responses solve the problem ( not passing by reference ), but they ignore the fact that you're passing null in, all you want is for the value to be returned.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I want to include the Outlook2Ctrl in a program, but I also want to split the right side area ( which is the remaining part ) horizontally into two panes.
I used a class derived from CSplitterWnd (by Daniel Zuppinger) and it's on this site. But I couldn't do it.
I tried to split, first vertically [CView || NULL]
then using the NULL pane I splitted the right vertically. But couldn't include the Outlook2Ctrl in the CView place.
Please help me...even by a hint...even not using the upper-mentioned splitter class.
Thanks
|
|
|
|
|
It sounds like you need to create your own class that inherits directly from CView, then add the Outlook2Ctrl control to that window. When the window is resized, call MoveWindow on the outlook control to make it the same size as the view.
-- Rocky Dean Pulley
|
|
|
|