|
I'm no SQL expert, but I think you can enclose the table name with square brackets.
SELECT * FROM [tara m]
(Still not sure why you're creating a table for each name though...)
You might post this question in the SQL forum.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Thank you. I shall check out the square brackets.
Steve Echols wrote: (Still not sure why you're creating a table for each name though...)
Well, the program is such that certain set of 'budget' data should be in one table. And when the user creates another 'budget' a new table with the new budget name has to be created. So if the user wants to delete the old 'budget' all I have to do is delete the table with that name. Makes life easy for me!
Fortitudine Vincimus!
|
|
|
|
|
It worked! Thanks a billion!!
Fortitudine Vincimus!
|
|
|
|
|
even though using brackets solve your problem, having spaces in a sql element is bad design matter. you should avoid doing so (bu replacing spaces with underscores for example).
moreover, the fact the brackets work is because you use MS SQL Server. a Oracle database wont allow you to do such a thing.
ps, this is a SQL question, which has no relation at all with C/C++. next time, ,ask the right forum !!
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
|
It is a Window Style that is supported by "some" Windows Controls.
When set the control sends owner draw messages that can be used to customize the UI of the control to a degree while still leveraging the other behavior and messages of the control.
The owner draw behavior is different for the controls, like Button is different from ListView.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Owner draw feature allows the customizing the existing controls or lets drawing the control from the scratch.
Currently, the following controls support OwnerDraw functionality:
Buttons
ComboBoxes
ListBoxes
ListView controls
Menus
Static controls
Tab controls
Whenever the item must be drawn Windows sends the WM_DRAWITEM message to the window procedure of the item’s owner window. This message contains a pointer to
a DRAWITEMSTRUCT structure.The application can customize the controls by handling this message.
Thanks
|
|
|
|
|
|
I'm trying a double indirect look-up table for some function pointer in my app (yep, I have good reason).
I'm trying to use std::map for the table but (because of the double indirection) I need to use a "std::map*"
Which I don't know how to map[index] (with a pointer)
Now perhaps I'm misusing it, I'm not sure (I know nothing of STL and I have some problem understanding its header)
Anyway here is my code (problem explained in red), if you could give me some tips.....
static std::map<const char*, SEL> map_sels;
static std::map<OClass, std::map<SEL, IMP>*> map_imps;
void id::GetImpAlways(const char* name, SEL& sel, IMP& imp)
{
if( !_handle )
throw gcnew ObjectDisposedException(Class()->Name);
if(map_sels.find(name) == map_sels.end())
{
sel = sel_register_name(name);
map_sels[name] = sel;
}
else
{
sel = map_sels[name];
}
std::map<SEL, IMP> * class_imps; <font color="red">
if(map_imps.find(_handle->class_pointer) == map_imps.end())
{
class_imps = new std::map<SEL, IMP>();
map_imps[_handle->class_pointer] = class_imps;
}
else
{
class_imps = map_imps[_handle->class_pointer];
}
if(class_imps->find(sel) == class_imps->end())
{
imp = get_imp(_handle->class_pointer, sel);
if( !imp )
throw gcnew ObjectiveCException("No such method");
class_imps[sel] = imp; <font color="red">
}
else
{
imp = class_imps[sel]; <font color="red">
}
}
<pre>
|
|
|
|
|
Have you tried dereferencing the pointer like:
*class_imps[sel] = imp;<br />
<br />
and <br />
<br />
imp = *class_imps[sel];
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I am afraid it will create a copy or affect a copy.
I need to alter the static global variable!!
I hate this stupid C++ copy policy, I need to affect the real shared object!!
|
|
|
|
|
Yeah, I agree. I use pointers for storing my objects in containers (right or wrong), just because I know (or think I know) there's only one instance of my object lying around.
I think these classes are good for simple intrinsic types, like ints, etc., but get kind of irritating when you have to define copy, less than and assignment operators for your classes. Just my opinion, of course.....
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
BTW, never mind my problem.
The program crash at the first line:
if(map_sels.find(name) == map_sels.end())
How do I do?
I have a home made C hashtable possibly I should use it instead :-/
|
|
|
|
|
Never mind STL...
I can't even add an element, it throws exception like:
at std._Tree<std::_Tmap_traits<void *,void *,std::less<void *>,std::allocator<std::pair<void * const,void *> >,0> >._Lbound(_Tree<std::_Tmap_traits<void \*\,void \*\,std::less<void \*>\,std::allocator<std::pair<void \* const\,void \*> <\,0> >* , Void** _Keyval)
at std.map<void *,void *,std::less<void *>,std::allocator<std::pair<void * const,void *> > >.[](map<void \*\,void \*\,std::less<void \*>\,std::allocator<std::pair<void \* const\,void \*> > >* , Void** _Keyval)
And what is it supposed to mean?
I just try to run this simple code:
static std::map<void*, void*> map_sels;
map_sels[(void*)name] = (void*)sel;
I dropped it, I will use my C Hashtable.
At least it is simple to use, make no copy and no fuss!...
-- modified at 2:17 Wednesday 12th July, 2006
|
|
|
|
|
Your problem has nothing to do with maps: it's a simple pointer error. Here's the relevant bits of your code:
std::map<SEL, IMP> * class_imps;
class_imps[sel] = imp;
class_imps is a pointer but you're using it as if it was a map . This should look like this:
(*class_imps)[sel] = imp;
Here's an example to make this clearer:
class Foo
{
void Bar();
};
void SomeFunction()
{
Foo *pFoo = new Foo();
pFoo.Bar();
delete pFoo;
}
Steve
-- modified at 3:01 Wednesday 12th July, 2006
PS: Use typedef s instead or repeating the long map types all over the place.
|
|
|
|
|
I knew I was calling the operator on an invalid object.
But I don't want to use "plain object" (as opposed to pointer).
if I do that, as far as I know, I will work with copy of the object, not the real object.
And I don't care about the life of the copies!
Anyway I dropped STL and used my own C implementation of hashtable.
No copy, no fuss...
|
|
|
|
|
I didn't suggest you not use a pointer. I suggested you don't confuse the pointer with what it points to. You done this:
class_imps[sel] = imp;
I suggested you do this:
(*class_imps)[sel] = imp;
In the first you're not even using the map, you're using a pointer to a map. In the second you're using the map and the only thing copied is imp when the map makes a copy to store. Given that the map 's mapped type is IMP this is exactly right.
Steve
|
|
|
|
|
You misunderstood what I said. I said the same thing as you!
That's understandable, as I probably confused you is when I implyed that (*class_imps) was making a copy.
Of course it doesn't, silly me!
Too late I am using my C Hashtable now.
It works well and there is absolutely no copy whatsover (whereas std::map use some sort of default allocator as far as I know).
beside I was not able to use it at all!
example:
std::map<void*, void*> map;
map[(void*)1] = (void*) 2;
is throwing some mysterious (and C++) looking exception.
|
|
|
|
|
Super Lloyd wrote: It works well and there is absolutely no copy whatsover
You're wrong there. If it stores pointers then the pointers are copied; same as with a map of pointers. If it stores IMP s then the IMP must be copied; again the same as a map of IMP s.
I tried your code and it works fine. Here's what I tested:
#include <map>
#include <iostream>
int main(int argc, char *argv[])
{
using namespace std;
typedef map<void*, void*> VoidStar2VoidStarMap;
VoidStar2VoidStarMap MyMap;
MyMap[reinterpret_cast<void*>(0)] = reinterpret_cast<void*>(1);
cout << MyMap[reinterpret_cast<void*>(0)] << endl;
return 0;
}
The reinterpret_cast<void*> is the same as the (void*) cast in your code. I make it a rule never to use C-style casts.
You're using managed C++ aren't you? I use unmanaged C++ - I don't approve of managed C++.
Steve
|
|
|
|
|
Stephen Hewitt wrote: You're wrong there. If it stores pointers then the pointers are copied; same as with a map of pointers. If it stores IMPs then the IMP must be copied; again the same as a map of IMPs.
Hum.. you're right....
Stephen Hewitt wrote: I tried your code and it works fine.
does it?
Stephen Hewitt wrote: You're using managed C++ aren't you? I use unmanaged C++ - I don't approve of managed C++.
I confess that I'm not that at ease with native C++.
I jumped from C to C#/Managed C++ (well I did some ObjectiveC & Java too)
But everytime I should do pure C++ brrr....
Not too mention that code that did compile in 1995 no longer compiled in 1998! (yes this way! not the opposite!)
And that GCC and CL don't support the same set of C++
Beside many tests failed to prove to me that C++ perform that much faster, so why bother
|
|
|
|
|
Super Lloyd wrote: Beside many tests failed to prove to me that C++ perform that much faster, so why bother
I've found it hard to find any benchmarks that I can trust. If I was going to use dotNET I'd use C#. The main problems I have with dotNET is firstly memory consumption and secondly the speed. Many dotNET supporters concede that the memory consumption is high but say RAM is cheap. I don't buy this argument: as a developer I have many, many applications open at the same time - If they all consume heaps of memory then the computer will start paging sooner and the whole system suffers.
Steve
|
|
|
|
|
hi frnds,
this error come due to parameter conversion failures.... but i hav tried for the best....
anybody having some better n easy solution...
line that is having error in my code....
DWORD dw=nthol(i_net(Ip.Getbuffer(MAX_PATH)))
Ip is a CString class.....
|
|
|
|
|
Just a wild guess here,
Is inet_addr what your looking for?
|
|
|
|
|
Well, for starters, your missing a closing parenthesis.
secondly, no need to use CString::GetBuffer() when you are needing a const char* since CString already has an operator for that. Only use CString::GetBuffer() when you need a buffer to pass into something. It won't hurt you here except you forgot the corresponding ReleaseBuffer() but that's a different story.
Thirdly, C++ is case sensitive so that call to strIP.Getbuffer() won't get you anything except another error to add to the list. strIP.GetBuffer() is probably what you meant.
Fourth, I took your code and fixed the above statements, included the #include "winsock2.h"
and made reference to ws2_32.lib and I was able to compile it and run it so I'm not sure what your fighting...
CString strIP="192.168.1.1";
DWORD dw=ntohl(inet_addr(strIP));
TRACE("Big Endian dw = %u\n",dw);
Any additional data in the time since your last post?
-- modified at 1:57 Tuesday 18th July, 2006
|
|
|
|
|
thanks for the help bob....
i will see whether ur code will help or not....but im sure it will help...thanks again......
regards..
frozen
|
|
|
|