C# :: ActiveX Control In Separate Thread
Jun 19, 2014
I have a method that does some extensive work (retrieves a list of emails from an imap server). What i wanted was to add a flash movie that would start playing when the method is entered and will stop when the method finishes. Something like this:
private void RetrieveMails() {
PlayFlashMovie();
RetrieveMailsFromServer{};
StopFlashMovie();
}
The flash movie plays, but the speed is horrible, almoust frame by frame (it actually matches the stepping of the foreach method that fetches the mails from the server as i can see it retrieving one mail - the movie plays one frame and stops; retrieves another mail - the movie plays another frame and stops.).
In the loop that retrieves the messages, i added Application.DoEvents(); so that is not the problem.
Now i am thinking of somehow playing that flash movie on a separate thread that will not hang synchronous with the retrieving mails loop but i don't know how would i do that...
View 2 Replies
ADVERTISEMENT
Oct 21, 2012
I'm writing an ActiveX control. In one of the functions I'd like the user to be able to pass me a pointer to a buffer that they created which I can then fill with data and return a success/error code. What's the appropriate way to do this? I was thinking about just using an OLE_HANDLE type for the parameter and then casting that to pointer inside the OCX but I'm not sure if that's safe or the right way to do it.
View 2 Replies
View Related
Aug 8, 2013
//#import "c:windowsSysWow64mscomctl.ocx" raw_interfaces_only //in window7
using namespace MSComctlLib;
CComPtr<IButtons> pButtons;
CComPtr<IButton> pButton;
CComPtr<IImages> pImages;
[Code] ....
View 11 Replies
View Related
Aug 9, 2013
I have an C++ application which uses Microsoft Web browser ActiveX control to launch any URL within the application. The browser is embedded in C++ form and It's working fine with all the feature Microsoft has exposed through Interface(IID_IWebBrowser2).But while any url that is using session cookie has been launched, even after closing the browser the session cookies are not getting deleted. For example if user login info is stored as session cookies,the url is using the cookies and getting launched without asking for user log in info.
But if I close the browser, and again relaunch , the cookies should be deleted and the url will not find the cookies to be used for log in . That is not happening here. Although this is session cookies , it's not getting deleted and being used by embedded browser. However, if the url is launched in IE, it is behaving as expected.
So, Do I need to delete the cookies explicitly? If Yes, How to do that?
View 2 Replies
View Related
Jul 30, 2014
I have a class which I wrote and one of its object is "SerialPort" .NET class. In my MainWindow I created instance of my class called "SerialPortComm", then I send through some functions of mine, commands to the Serial Port, and I receive answers through "DataReceived" event.
But when I trying to use Dispatcher.BeginInvoke to write my data I have received (successfully), nothing shows on the RichTextBox which I'm trying to write to.
What can caused that, and How I can make it works?
SerialPortComm.cs
public partial class SerialPortComm : UserControl {
public SerialPort mySerialPort = new SerialPort();
public void Open_Port(string comNumber, int baudRate) {
mySerialPort.PortName = comNumber;
mySerialPort.BaudRate = baudRate;
[Code] ....
View 7 Replies
View Related
May 24, 2014
I have researched quite extensively, experimented, and still cannot seem to change the properties of a control on an active winform from a user control.
So I have a user control which populates each dynamically added tab page in a tab control.
I have a textbox in the user control which I would like to type in, capture the text_change event, and change the text of the label in the winform.
View 14 Replies
View Related
Apr 25, 2014
How do I bind a DATE column in a DataGridView Control to a DatePicker control (using C#)? I already have the DataGridView control bound to a database stored procedure which takes a DATE value as a parameter and selects joining table based on the results.
View 7 Replies
View Related
Jan 13, 2015
I would like to know in which way is the best to make ActiveX control for video. ActiveX control will need at least show picture and be able to go back in past, change resulation of picture and similar. How complex it is to do something like that? Is MFC best way to make it? Is there somewhere similar code?
View 2 Replies
View Related
Mar 17, 2014
I'm trying to open PDF file in my MFC application. For this I have installed Adobe Reader 10 and added the ActiveX from resource editor to my dialog.
Created a variable of that type and trying to use that. Class wizard has generated "class CPdf1 : public CWnd" for me and that's added to project.
Now when I'm trying to create the control window getting Assertion failure. Using the below code in my OnInitDialog / some button clicks.
Code:
m_PDF.Create(_T("Reader Window"), WS_CHILD | WS_VISIBLE, CRect(0, 0, 200, 300), this, 2009);
Am I missing some steps ?
View 4 Replies
View Related
Oct 10, 2013
I have a MFC Com Dll that has a CDialog. In the OnCreate event I create an ActiveX control. The dll is hosted inside an executable of mine. In this scenario everything works fine!
The dll is also called from an external executable and then a Debug Assertion in OCCSITE.cpp occurs when I create the ActiveX control. I suspect that in the executable there is no AfxOleInit. I spend some time with this problem and tried to CoInitialize, OleInitialize, AfxOleInitModule and even AfxOleInit in the dll. But all that does not change a thing. If I understand the mechanics then this is an intended behaviour and should be done in the host exe.
What I observed in the OCCSITE.cpp:
Code:
_AFX_THREAD_STATE* pState = AfxGetThreadState();
if (!pState->m_bNeedTerm && !AfxOleInit())
return hr;
In my executable m_bNeedTerm is 0 and in the external one (where the ActiveX does not work) it is -1. In AfxOleInit this is explained as a special flag to prevent the dll from doing an unnecessary OleInitialize. But as I said even if I call OleInitialize myself I get the Debug Assertion and the ActiveX is not visible.
Is there anything I can do to make the ActiveX control work in the external application? Obviously I cannot Change anything in the application...
View 1 Replies
View Related
Jan 20, 2014
I`m working with MS Visual Studio 6. Trying to connect Word server with my window. This is call server in my class CXContainerView, inherit from CScrollView:
Code:
void CXContainerView::CreateWord() {
::CoInitialize(NULL);
_Document doc;
_Application m_app;
LPDISPATCH lpDisp;
CLSID clsid;
[Code] ....
It works in debug version but falls in release. Feels my fifth point, what I call it in the wrong way.
View 6 Replies
View Related
Feb 27, 2014
I'm working on a project which consists of several ocx loaded by one exe. The platform is WinCE. Now I'm on a process to create a new ocx. I do have a copy of those ocx projects in Win32 platform. These Win32 versions were only used to register ocx in local system and then put those on to application dialog by 'Insert ActiveX'.
Now the problem is those Win32 projects are so outdated, and unable to build. Getting too many linking errors to be solved.
I have build the new ocx and link that with exe manually by editing .rc file and all. But still no luck. New ocx is getting registered in WinCE device but failing to start application.
View 6 Replies
View Related
Oct 22, 2014
I know the user installation must involve some registry manipulations and some other trickery. But the ActiveX way seems to be more modular.
Is it worthwhile to separate the charting modules from the exe and make an activex dll for this purpose?
View 5 Replies
View Related
May 6, 2013
I will post the entire code at the bottom. Its running fine right now but This part in the menu function I need to make as a separate function. My problem is when I make it into a function by itself I have to declare and initialize the grades A,B,C,D,F how can I do that when I can't make them equal 0 because it has to keep track of how many of each letter grade.
Code:
//Count letter grade
if(ave >= 90)
++A;
else if (ave >= 80)
++B;
else if (ave >= 70)
++C;
else if (ave >= 60)
++D;
}
[code]....
View 3 Replies
View Related
Nov 3, 2013
i'm reading from a text file which includes a dictionary in UTF8. it has the following structure:
word, bla "bla" translation
so there's a word and a translation seperated by tab. both can include any kind of charactars, excluding tab of course, especially blanks (found one code that claimed to seperate a string at tab, but also did at blank).
how can i seperate one line into two (or more) strings at the tab? i've been searching for a while, but can't find anything useful...
View 2 Replies
View Related
Apr 9, 2013
Code:
class A
{
public:A(int a, int b);
};
I need to have an object of class A that doesn't have a default constructor in another class, B:
Code:
class A; //This is in a separate header file
class B
{
private:A a;};
The problem is that it won't compile without a default constructor. I'm not allowed to define a default constructor, and the A object in class B has to be private so I can't initialize A a in public.
I also can't change the prototype in the interface to something like
A(int a = 0, int b = 0);
since one of the requirements is that if an object of class A is declared in main, it must not compile due to not having a default constructor. So what can I do to make class B work and compile?
Another question I have is why is this valid:
Code:
class A; //#include "A.h" is in the implementation file so it compiles.
class B
{
private:A* a;}; But not this: Code: class A;
class B
{
private:A a;};
This is for a project that I probably won't be able to turn in on time, but I care more about how to do this right than turning it in for full points.
View 4 Replies
View Related
Apr 7, 2013
I have a set range, say 10 to 100, and I'm trying to separate the numbers evenly into 5 arrays. So there are 90 numbers, how can I assign 10 - 27 to the first array and the next 18 numbers to the next array without creating separate loops for each one?
View 3 Replies
View Related
Feb 2, 2014
How to compare the username and password entered by user with the data(username and password saved in before) in the admin array and customer array,
so for example when it match the username and password in the admin array, it will directs the user to the admin_mainmenu(), otherwise it directs to the customer_mainmenu().
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
char username_admin[10];
char password_admin[10];
[Code] ....
View 1 Replies
View Related
Dec 12, 2013
How to use a function twice to calculate two different variables. How to have a function compute the city tax, then it uses the function a second time to compute the county tax.
My program compiles, and runs fine, however it only outputs the city tax calculation. It seems it never attempts to calculate the county tax.
One thing: All of the directives I used is what we are limited to, no more, no less. He requires a set format and will dock points of you use anything but those directives and void main().
Here is my code so far:
/* function for city tax calculation */
#include <iostream>
using namespace std;
#include <string>
#include <cstdlib>
#include <cmath>
#include <iomanip>
const double city_tax_rate=0.03;
[Code] ....
I am using Visual studio 2010.
View 9 Replies
View Related
Nov 28, 2014
my insert() function
template <class T>
class Node
{
public:
[Code]....
View 6 Replies
View Related
Oct 13, 2014
I have a big big problem with class template
//file Array.h
#ifndef ARRAY_H_
#define ARRAY_H_
template <class T> class Array {
[Code] .....
I've tried many ways:
1. put #include<Array.cpp> at the end of file Array.h
2. Change Array.cpp to Array.hpp,...
But dont work at all
I have tried to separate class template into two files.
View 13 Replies
View Related
Feb 2, 2014
How to compare the username and password entered by user with the data(username and password saved in before) in the admin array and customer array,
so for example when it match the username and password in the admin array, it will directs the user to the admin_mainmenu(), otherwise it directs to the customer_mainmenu().
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
char username_admin[10];
char password_admin[10];
[Code] ....
View 2 Replies
View Related
Jan 31, 2014
I could do the assignment if all i had to do was create a function within one file, call it in the main class, and that would be done with it. no, my teacher wants us to have our main program, a header and a separate class file and create functions in it in which we can then use in the main file.
This is the main file:
#include <iostream>
#include "call.h"
using namespace std;
int main() {
int length; //holds the length of the call in minutes
int hour; //holds the hour od the day(0-23 military time)
[Code] .....
View 7 Replies
View Related
Mar 31, 2014
#include<iostream>
#include<string>
using namespace std;
//Constructors for class.
class CollegeCourse {
private:
int courseNum;
[Code] ....
When I debug my program, the objects is showing up on one line bunched up together. I also want to be able to enter data after each object of the classes.
The details of my project is as follows:
Inheritance in C++ means you can create classes that derive their attributes from existing Classes, in other words, a newly created class can absorb all the data fields and functions of a class already being used. When one class is derived from another, the original class is the parent class, base class, or sometimes called the parent class. The derived class is a child class, or sometimes called the subclass.
Inheritance is central to Object Oriented Programming. The advantages of inheritance are it allows the code to be reused as many times as needed. Inheritance also saves time and effort as the main code need not be written again.
Create a C++ program using Visual program that could be used by a college to track its courses. In this program, create a CollegeCourse class includes fields representing department, course number, credit hours, and tuition. Create a child (sub class) class named LabCourse, that inherits all fields from the CollegeCourse class, includes one more field that holds a lab fee charged in addition to the tuition. Create appropriate functions for these classes, and write a main() function that instantiates and uses objects of each class.
View 1 Replies
View Related
Dec 24, 2012
C++ program to accept a value and split it digit by digit and display in name
E.g.: 123
>one two three
View 4 Replies
View Related
Mar 6, 2015
I working on a big program, and it involves character arrays. What I want my function to do is create a seperate array that consists of the same number of "*" as there are letters in the word from the text file. For example, if the word sarc was up, the function show make ****. This was my attempt at it. I managed to reach this far. I can only fit in one "*". This is part of jumble game program I'm trying to make, and its in C language.
insert Code: void partialWord(char current[]){
int n;
int i;
n = strlen(current);
for (i = 0; i < n; i++){
current[i] = strcpy(current,"*");
}
printf("%s
", current);
}
View 7 Replies
View Related