|
There is a addin (at least under VC++ 6 there is)
Project - Add To Project - Components and Controls
In the Visual C++ Components folder find ActiveX Control Containment Component
This should make your WebBrowser work.
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
To fix this problem I dynamically create (using the new operator) the web browser control member variable in my OnInitDialog()
This fixes the problem for me.
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
_bstr_t str;
str= "SELECT * FROM Tennis ORDER BY Name";
if( pDoc->m_pConnection==NULL )
return ;
_variant_t vRecsAffected(0L);
try
{
pRecordSet = pDoc->m_pConnection->Execute( str, &vRecsAffected, adOptionUnspecified);
.
.
.
I recevie run time error for Execute() line,in output window:
Exception thrown for classes generated by #import
Code meaning = Unknown error 0x800A0BB9
Source = ADODB.Connection
Description = Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
you initialize str - that's ok
but what is "sqlstring"?
regards, b.
|
|
|
|
|
sqlstring is sql;) Thats something I missed when I copy/paste my codes here.Now I have to correct it.So my Problem is not solve.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Also:
When I debug that line for str I see that it is "Bad Ptr" and "CXX0030: Error: expression cannot be evaluated".
So there is a problem with that?Does anybody know whats that?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
try _bstr_t str = L"sfjdsfhsdfh";
|
|
|
|
|
no,that does not help
Thanks for reply
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
In my experience, when you get a bad args error, it's more than likely that it's your SQL that's at fault. How about:
SELECT * FROM [Tennis] ORDER BY [Tennis.Name]
Just a guess...
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Thank you Derek,I found the problem before,It was because of openning my database,my database was openned so it caused runtime error.
Thank you again.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
i declare a function pointer like this:
void (*PTestFunc)(CString& str);
and two classes:
class CTest
{
...
void Test()
{
m_pTestFunc(CString("fdsaf"));
}
void SetFuncPointer(void* pointer)
{
m_pTestFunc = pointer;
}
PTestFunc m_pTestFunc;
...
}
class CMyClass
{
...
CString m_strCaption;
void MyTest(CString& str);
void Init(CTest& test);
...
}
CMyClass::MyTest(CString& str)
{
m_strCaption = str;
}
void CMyClass::Init(CTest& test)
{
test.SetFuncPointer((void*)MyTest); //error c2440
}
//////////////////////////////
if i add "static" before MyTest, it is right;
but u see i need this pointer in my class, i can't set MyTest static. so how to solve this problem? does c++ define the class member function pointer?
c++ : my dream
|
|
|
|
|
|
Not sure if this will solve your problem
http://www.codetools.com/script/comments/forums.asp?forumid=1647&app=50&fr=251#xx142181xx
Todd Smith
CPUA 0x007 ... shaken not stirred
|
|
|
|
|
"Browse for Folders from the Current Directory" topic ( http://support.microsoft.com/default.aspx?scid=kb;EN-US;q179378 ) describes how to Browse for Folders from the Current Directory using SHBrowseForFolder function. But it was not works correctly when using "network path" like "\\SomeComputer\SomeFolder\Folder".
gCan you help me?
|
|
|
|
|
I've not used it for network browsing, but I know it has a flag for browsing networks ? Have you tried that ? What is going wrong ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Check this code: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q179378
.
.
.
INT CALLBACK BrowseCallbackProc(...)
{
.
.
.
case BFFM_INITIALIZED:
// !!!
if (GetCurrentDirectory(sizeof(szDir)/sizeof(TCHAR), szDir)) {
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)szDir);
.
.
.
If GetCurrentDirectory(...) is a directory with a simple path (e.g. D:\WinNT\System32) SHBrowseForFolder work correctly - select folder D:\WinNT\System32 in tree,
but if GetCurrentDirectory(...) is a directory with "network path" (e.g. \\SomePC\SomeFolder) SHBrowseForFolder does not selects this path.
You can check it: just run this sample from net directory.
|
|
|
|
|
Ok,... I finished a bunch of more reserch and these are the things in which i either didnt exactly understand or just questions at random about certain things that i would like to know...
To organize this, if you want to: write the thing that you are weilling to help with in the subject for the reply. "This will make it easier to reply to your answers " And for any other newbie around may find help in this thread.
~Hex Dec Oct: What is the differance and why use them seperat from each other.
~Globals: How do you decalare a global inside of a little program? or change them around? I had my main program read through somthing that looked like this...
int main()
if(boolone = true);first();
if(booltwo = true);second();
and so on...
then i wanted it so that when your inside of the program first, there would be a gets or cin and if you typed in one off, the program would set the boolone to false and the program wouldnt read anything in there. I could have done somthing extreamly wrong and stupid in the program, but everything checked out and it still didnt work...
~MFC - C++: Ive asked this question before... im going to build a game engine that would allow me to build 2D games that i would like to host over the internet... The engine i would like it to be all in windows, but what language or toolkit should i use? MFC or C++, what one would give me more flexibility and make the job allot less work than it already seems to be?
~Null: Ive seen the 'null' statement used all the time, but i dont know what it is used for. "i think this is a vary newbie question but you know "
~Clear Screan: When ive bean building line based games in DOS ive always wanted to clear the screan for that the game would look slightly better... How do i do this? "Ive asked this one before also sodo be annoyed "
~Switch (break and continue): I understand the switch "I think" but im not to sure on break and continue commands... How do i use them?
~Delete: how do i use this? and what is the syntax?
~Public: I looked this one up, but didnt understand. Public: its not a goto statment is it? (dont think so) why use this? also, there is a private: one, how do you use these and why?
~return: Return like in the int main() and return 0; i understand, but... there is other things that you can do with the return statment that i dont quit get... can any one help?
~Get line: What does a get line do? and what is the syntax for doing so?
~#if and #define and #endif #else... : why is there a # sign on these? and the define, what does it do, or what is its purpose?
~std::stream: What does this do?
~std::fstream: what does this one do, and what is its differance to the other one?
~if stream and stream: what do these do? "these last ones are just a (curiosity) and could probably help allot in the future.
~Class: what is a class used for?
~Sound: I really desire to make a sound engine for my game, "and if not in my game" just somthing that would be fun to program and mess around with. But i dont know exactly where to start with the sound and how to send sound to the speakers. Can anyone help in this?
Well, thats all, "allot of questions like i said" but this is like a week of reading and toiling with out asking any at all " Some of the questions may be stupid and some maybe so lame or easy that maybe a quick syntax would help Sorry for the annoyance "to those who this annoys..."
Thanks all for hum responds... and for viewing this thread.
~SilverShalkin
I did have a cool poem that i made up, but
i left it in my graphics class, and the last
time that i posted, i reposted it on a poetry forum
and they said it sucks "that was them being
nice... So next one, after posting it onto the
poetry forum, ill post it here
|
|
|
|
|
~ Hex, Dec, Oct... First, you have to remember that everything to a computer is just a binary number. Hex, Dec, oct are just different ways we use to make those binary numbers readable to humans. Decimal is what we are use to from our youth. Hex is very handy with 8bit systems where 2 hex digits represent the byte of data. Octal is really an outdated system.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Tim Smith wrote:
Hex is very handy with 8bit systems
Ill keep that in mind so.. i shouldnt really bother with octals?
Thanks for your time
~SilverShalkin
Srcatch another
|
|
|
|
|
SilverShalkin wrote:
i shouldnt really bother with octals?
The key thing is that unless you're displaying the values, the computer doesn't actually care, it's just going to turn it into binary anyhow.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
globals are variables or objects that are available to a whole program rather than to just a function or a class., You declare them outside any function or class. Now the whole application can use it. If you have multiple source files you'd have to redeclare them in each of thise files using extern.
Nish
I am the Keyboard Smasher
|
|
|
|
|
you redefine the globals with extern? could you use that in an example? or does it look something like...
int first();
bool one = false;
int main()
{
first()
}
first()
{
extern one "Im just guessing "
}
Thanks...
~SilverShalkin
Scratch one
|
|
|
|
|
Let's say you have two files
a.cpp and b.cpp
Now if you have an int y in a.cpp and an int y in b.cpp, they'd be two separate ints. The idea of a global is to make it application global.
This instead of int y you should declare them as extern int y which tells the compiler than this variable has external linkage. Thus in the final executable this will be a single global variable
Nish
I am the Keyboard Smasher
|
|
|
|
|
SilverShalkin wrote:
~Hex Dec Oct: What is the differance and why use them seperat from each other.
Hex: base-16 number system. Valid "digits" are 0-9 and A-F (A=10, B=11, .., F=15). More convenient to use and easier to read than binary.
Dec: The number system you've used since you started learning.
Oct: base-8 number system. Valid "digits" are 0-7. Alternative format for binary number. Used with the Unix command chmod, for example.
SilverShalkin wrote:
~Switch (break and continue): I understand the switch "I think" but im not to sure on break and continue commands... How do i use them?
Compares discrete values. For example, if you have a set of integers, you can handle each case separately:
switch(someValue)
{
case 0:
break;
case 1:
case 2:
break;
default:
break;
}
break in this case breaks you out of the switch statement so that, if someValue == 0, you don't keep executing the handlers for 1/2 and the default. break will also break you out of a loop.
continue will take you back to the top of a loop without having to execute it all the way to the end. Useful if you know that you don't want to finish processing an iteration, and you just want to move on to the next one.
SilverShalkin wrote:
~Delete: how do i use this? and what is the syntax?
Use this to free memory you created dynamically on the heap.
char *pChr = new char;
delete pChr;
char *pStr = new char[256];
delete [] pStr;
You could also use NULL here. Since you can't reference the memory that both pChr and pStr used to point to, you should set the to NULL (i.e., nothing).
pChr = NULL;
pStr = NULL;
Jon Sagara
There is no spoon.
Best Miniputt score: 21
|
|
|
|
|
SilverShalkin wrote:
~Public: I looked this one up, but didnt understand. Public: its not a goto statment is it? (dont think so) why use this? also, there is a private: one, how do you use these and why?
By default, methods and members of classes are private. In order to make them accessible outside of the class, you need to declare them as public.
class CMyClass
{
public:
protected:
private:
public:
};
I'm tired. I'm going home. Maybe someone else can pick up where I left off.
Jon Sagara
There is no spoon.
Best Miniputt score: 21
|
|
|
|
|