|
I have a VC++ application that link/update/retrieve data of a MS access mdb file on the web. However, I do not know how to launch/open a web page through this application
Anyone knows how to do it? If so, can we are able to close it after launching?
*) The reason I ask for help, because I need to update data to that MS access mdb file without requiring the user to launch the web page himself!
Thanks for any help
|
|
|
|
|
ATC wrote:
However, I do not know how to launch/open a web page through this application
Have you tried ShellExecute() using the "open" verb?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi David,
I only use ShellExecute(...) to launch a local application but not in the web, I did verify to use ShellExecute(...) to launch a web page, but none available! Do you know any link/guide?
To link to the web site I used pConnect->OpenFile (fileSem, GENERIC_READ, FTP_TRANSFER_TYPE_BINARY,1); or similiar to transfer, write or read a datababse ... not to launch a web page!
Might be you kind of provide me a simple command to launch a Web page?
Thanks
|
|
|
|
|
ATC wrote:
I did verify to use ShellExecute(...) to launch a web page, but none available!
Using ShellExecute(..., "open", "somefile.html", ...) will open the web page just fine.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi David,
You solve my problem, I am able to launch my web page now.
Many thanks,
|
|
|
|
|
ATC wrote:
I have a VC++ application that link/update/retrieve data of a MS access mdb file on the web
Please clarify what you are trying to do. Is the mdb on a remote server which has a web interface? Are you trying to access the web interface from a client application? Or all you need is to launch the browser and make it connect to some URL?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi Jose,
David helped me to launch my web page inside my VC++ application, it is OK now.
Thanks for trying to help
|
|
|
|
|
Dear fellow developers
We’ve developed a windows based desktop application. The application is built using Visual C++ 6.0 and MFC.
In our application we are automating MS-Word. The user clicks on a button and as such MS-Word application gets opened which hosts the desired document. When the word document gets opened, the user starts typing on the word document as usual. Once the user finished with the typing process he/she saves the document and then closes the document and afterwards the word application.
The resultant software is working fine on our machines. But when we released the software to our clients, MS Word starts creating the trouble.
Here is the description of the problem: The user launches MS word document from our application and starts typing in it. Now during typing, the MS-Word application gets crashed. This behavior is produced unexpectedly and is not reproducible. It is only happening in the MS-Word instance which is automated by our application and not by the externally launched MS Word instance.
We’ve made some research on the machines where this problem is occurring. And we’ve noticed that those machines are short of Virtual memory.
During the course of time when MS-Word window is opened, the application (or our automation client) only calls the word Save function and also calls the function which returns the current selected text. We only use MS-Word 2000.
Please advice us how can we get rid of this issue. Please also suggest us the ways to trace this error.
|
|
|
|
|
I have written code to get contact of Outlook Express.It is working fine in MFC.I am trying to make ActiveX control on asp page.I am not getting output i.e. ActiveX Control.It becomes busy downloading the page.I thing because of LoadLibrary() it is not working.I had done same thing for Microsoft Outlook successfully.Please tell me what is the problem?
sanjay kumar
|
|
|
|
|
in my program i have two buttons............ one buttonn will start an infinite while loop. I want that when the second button is pressed the program should exit that while loop.........
How can i do that
plz be elaborative as i m a beginner in VC
the more u give the most u receive
|
|
|
|
|
This looks like homework.
Create an event handler for the first button and in the event handler break out if the second button is pressed.
You should be able to work the rest out yourself otherwise you will not learn.
Elaine
The tigress is here
|
|
|
|
|
|
If it's a true infinite loop, it is unexitable.
Good music: In my rosary[^]
|
|
|
|
|
for UZMA..
//Declare these in the class header file...(.h)
static UINT runLoop(LPVOID p);
void runLoop();
///Put this in the implementation file....(.cpp)
UINT UZMAPPDlg::runLoop(LPVOID p)
{
UZMAPPDlg * me = (runLoop *)p;
me->runLoop();
return 0;
}
void UZMAPPDlg::runLoop()
{
do
{
///UZMA's story
}while(true)
}
in the click events(by double-clicking on the buttons!!), put
void UZMAPPDlg::OnButton1()
{
CWinThread cwt=AfxBeginThread(runLoop, this); //Start your loop
}
void UZMAPPDlg::OnButton2()
{
////Manipulate your cwt Object... here , resume,close etc
}
hope it'll work
regards,
vivek
|
|
|
|
|
Just have the nearly infinite loop terminate on a flag being set. Inside the loop pump the message queue. In the command handler for the other button, set the flag.
There is no need to create threads to do this.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
There is no need to create threads to do this.
if he doesn't, his GUI will be frozen...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thus the requirement to pump the message queue. How do you think programs did it prior to having threading?
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Why the following snippet causes runtime error and got prompt for"Unhandled exception...stack overflow"?
#include <iostream>
#include <stdio.h>
using namespace std;
class A
{
public:
A(){}
~A(){cout << "Leaving A" << endl;exit(1);}
};
A a;
int main()
{
}
|
|
|
|
|
Works without runtime error under Visual C++ .NET 2003
|
|
|
|
|
Mark Petrik Sosa wrote:
Works without runtime error under Visual C++ .NET 2003
I work under Visual C++ 6.0.
|
|
|
|
|
I think it is because it is a global object, and when you call exit(), it calls the global objects's destructor, which causes an endless loop.
Make it a local object, and it runs with no problems.
Remove the exit(1) call from the objects's destructor.
I am still confused.
this is this.
|
|
|
|
|
khan++ wrote:
I think it is because it is a global object, and when you call exit(), it calls the global objects's destructor, which causes an endless loop.
Yeah, I guess you're right!
|
|
|
|
|
i don't understand why just because it is global, the constructor can't be called correctly...
i don't understand either why calling a function (the constructor here) would enter an endless loop...
sorry, i didn't see the ending exit(1) on its destructor...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Part of the startup and shutdown process of an image in C/C++ is to execute init and exit vectors. These vectors contain pointers to code that performs many functions including global object construction and destruction. Thus, the calling of exit can cause the exit vectors to be executed again which in turn causes the destructors to be called again.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi, as you 've probably guessed I tring to create a dll and use it in another program. So I've search some articles and I 've found a few interesting things. However when I try to execute a simple program it doesn't seem to work. Let's be a bit more specific.
<br />
#include "stdafx.h"<br />
#include "greet.h"<br />
#include <cstdio><br />
<br />
BOOL APIENTRY DllMain( HANDLE hModule, <br />
DWORD ul_reason_for_call, <br />
LPVOID lpReserved<br />
)<br />
{<br />
switch (ul_reason_for_call)<br />
{<br />
case DLL_PROCESS_ATTACH:<br />
case DLL_THREAD_ATTACH:<br />
case DLL_THREAD_DETACH:<br />
case DLL_PROCESS_DETACH:<br />
break;<br />
}<br />
return TRUE;<br />
}<br />
<br />
GREET_API int ngreet=0;<br />
<br />
GREET_API int fngreet(void)<br />
{<br />
return 42;<br />
}<br />
<br />
Cgreet::Cgreet()<br />
{ <br />
return; <br />
}<br />
<br />
void Cgreet::run(int arg)<br />
{<br />
printf("Hello World!\n");<br />
}<br />
The above code is produced by VS 7.1 when asked to create a new win32 console project and dll is selected. I 've also added another method to the class created. I also give you the header file VS created.
<br />
#ifdef GREET_EXPORTS<br />
#define GREET_API __declspec(dllexport)<br />
#else<br />
#define GREET_API __declspec(dllimport)<br />
#endif<br />
<br />
class GREET_API Cgreet {<br />
public:<br />
Cgreet(void);<br />
<br />
void run(int arg);<br />
};<br />
<br />
extern GREET_API int ngreet;<br />
<br />
GREET_API int fngreet(void);<br />
Well now I create a simple win32 console project with the following code
<br />
#include <cstdio><br />
#include <windows.h><br />
<br />
int main()<br />
{<br />
HMODULE hdll = LoadLibrary("greet.dll");<br />
if (hdll != NULL)<br />
{<br />
typedef int (*PFUNC)(void);<br />
<br />
PFUNC greet = (PFUNC)GetProcAddress(hdll, "fngreet");<br />
if (greet != NULL) {<br />
printf("greet.dll returned: %d!\n", greet());<br />
}<br />
else<br />
printf("Loading function 'fngreet' failed!\n");<br />
}<br />
else<br />
printf("Loading library 'greet.dll' failed!\n");<br />
}<br />
The output of execution is:
'Loading function 'fngreet' failed!\n'
I 've also seen in another post someone asked functions like "_fngreet" but that also didnt work. What am I doing wrong? Looking the code with the debugger I see in my main program that hdll pointer gets a weird address.
hdll 0x10000000 {unused=9460301 } HINSTANCE__ *
That's what the debugger says about hdll and of course greet fpointer is null.
Another question, let's say that I manage to get the function pointer loaded dynamicly. How will I load the Cgreet class? Does GetProcAddress works also for classes? What about variables?
That's all I guess!
Cheers, Themis
|
|
|
|