|
IN Continuation With Mr Santosh!
you must call CoIntialize(NULL) before Calling DllUnregisterServer
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Alok,
Is that mandetory?
« Superman »
|
|
|
|
|
Santosh M. P. wrote:
Is that mandetory?
yes Santosh, if you see defination of any DllUnregisterServer
STDAPI DllUnregisterServer(void)
{
return _Module.UnregisterServer(TRUE);
}
here DLLUnregisterServer is Using Com Interfaces and to use com interface COM must be Intialised!
Hope, you got my Point!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
yes Santosh, if you see defination of any DllUnregisterServer
CoIntialize() is used to Initializes the COM library. That is if you are using any com library functions you do this. But _Module is not created with CoCreateInstance() or something like that. So I don understand the need of CoInitialize() in this scenario.
suhredayan There is no spoon.
|
|
|
|
|
suhredayan® wrote:
That is if you are using any com library functions you do this. But _Module is not created with CoCreateInstance() or something like that
Hope So! Let's Try!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
Hope So! Let's Try!
suhredayan There is no spoon.
|
|
|
|
|
I need source codes of video capture and video network transfers
Who can help me? thank you.........
|
|
|
|
|
|
hi
I have built the connection to the database and fetching the values first i hae to take in _variant_t and then convert in _bstr_t i have achieved that but myproblem is that:
I am using SQL 2000 and i have a field authString by default value is <null> when if i select that value which is null what should it return i am getting error .
I want to check if it is Null, If it is i will update that otherwise not .
what should i do.
jhon
|
|
|
|
|
Hi,
I need some advice/help in writing a program to parse XML file (using DOM) and returning element inside a particular tag. So if I select a tag identified by its tag value, it should give me the element inside that tag.
Appreciate all your help.
Thank you
Ray
|
|
|
|
|
|
|
Use Microsoft's javascript engine.
Don't try it, just do it!
|
|
|
|
|
Thanks for replying, but I didn't get any info about it, can you give me some introductory information regarding that. Thanks in advance.
http://www.priyank.in/
|
|
|
|
|
i have been Written a Hanoi's tower that base on GUI using VC++ development.
Now, the program has a few bugs, but i havn't know where that errors are. soon i will revise these errors, maybe the program is fun and u can take the Hanoi's tower to study recursived program with C or C++, For the moment, the source codes can't opening line but that will be quickly, [There ]is to download the program demostration.
Any proposes as follow comments.
|
|
|
|
|
Hi All,
I am facing problem of handle leak in my Application.
While using AfxBegin thread creating a worker thread in suspended mode and then resuming the thread using resumethread.
During above process 7 Handles are getting created but when I am exactly closing the thread using PostThreadMessage(WM_QUIT, NULL, NULL) only 5 handles are getting closed. Two handles are not being closed.
The details is like This:
m_pControlThread = AfxBeginThread (
ControlThreadLoop,
( LPVOID )this, THREAD_PRIORITY_NORMAL,
0, CREATE_SUSPENDED
);
m_pControlThread->ResumeThread();
from above 7 handles are getting opened.
In Destructor Closing like this:
if (m_pControlThread)
{
m_pControlThread->PostThreadMessage(WM_QUIT, NULL, NULL);
WaitForSingleObject( m_pControlThread->m_hThread,
_MESSAGE_TIMEOUT );
delete m_pControlThread;
}
Here only 5 Handles are getting closed...
Where remaining 2 handles are missing .... I am not getting any Idea..
Please suggest..
Thanks,
Jokhan
|
|
|
|
|
That could be normal behaviour. Windows likes to keep some handles around to be reused later. The way to check if this is the case is to run and stop your thread multiple times. If the total handle count does not keep climbing you are ok, if it does climb you have a problem.
ie: handle count is 0...7...2...7...2...7...2...7... etc OK
" " " 0...7...2...9...4...11...6...etc Error
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Hello Arends,
Thanks for your suggestion.
You are right but In my case the total ( after few iteration of start and stop) number of handles are increasing. And it is 2 handles per iteration.
And As I have written in posting: while quiting the thread only 5 handles are getting closed though each time 7 handles are getting opened.
Please suggest!!
Thanks,
Jokhan
|
|
|
|
|
|
i trying to disable mouse wheel in comboBox , i try to find this option in propertise but i dont find this option .
In comboBOx control i also can`t find this option.
Someone can Help me ??
How can i do it ??
|
|
|
|
|
A very nasty trick would be to derive a class from the combobox control, use it in place of your combobox control, capture the mousewheel messages WM_MOUSEWHEEL and then don't forward them to the base class...
~RaGE();
|
|
|
|
|
I can't figure out why the arrays dip_array,azim_array aren't yielding the proper values:
<br />
<br />
#include <math><br />
#include "stdafx.h"<br />
#include <iostream><br />
using namespace std;<br />
<br />
double theta, phi, t, p;
double lambda1 = 0.5;<br />
double lambda2 = 2;<br />
double a11,a12,a21,a22,d11,d13,d31,d33;<br />
const double pi = 3.142857;<br />
const int rows = 3;<br />
const int cols = 3;<br />
<br />
double a(double p)<br />
{<br />
d11 = cos((p*pi)/180);<br />
return d11;<br />
}<br />
<br />
double b(double p)<br />
{<br />
d13 = -1*sin((p*pi)/180);<br />
return d13;<br />
}<br />
<br />
double c(double p)<br />
{<br />
d31 = sin((p*pi)/180);<br />
return d31;<br />
}<br />
<br />
double d(double p)<br />
{<br />
d33 = cos((p*pi)/180);<br />
return d33;<br />
}<br />
<br />
<br />
double e(double t)<br />
{<br />
a11 = sin((t*pi)/180);<br />
return a11;<br />
}<br />
<br />
double f(double t)<br />
{<br />
a12 = cos((t*pi)/180);<br />
return a12;<br />
}<br />
<br />
double g(double t)<br />
{<br />
a21 = -1*cos((t*pi)/180);<br />
return a21;<br />
}<br />
<br />
double h(double t)<br />
{<br />
a22 = sin((t*pi)/180);<br />
return a22;<br />
}<br />
<br />
double dip_array [3][3] = {{a(p),0,d13},{0,1,0},{d31,0,d33}}; <br />
<br />
double azim_array [3][3] = {{a11,a12,0},{a21,a22,0},{0,0,1}}; <br />
<br />
double lambda_array [3][3] = {{lambda1,0,0},{0,1,0},{0,0,lambda2}}; <br />
<br />
double r_array [3][1] = {4,8,3.94};<br />
<br />
<br />
void printarray (double arg[][3]) <br />
{<br />
for (int i=0; i<3; i++)
{<br />
for (int j=0; j<3; j++)
cout << arg[i][j] << " ";<br />
cout << "\n";<br />
}<br />
}<br />
<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
<br />
cout<<"ANISOTROPY MODELLING.\n";<br />
cout<<"Please enter a real number between 0 and 360 for the azimuth angle, theta, then press the 'Enter' key.\n\n";<br />
cin>>t;<br />
<br />
cout<<"Please enter a real number between 0 and 360 for the dip angle, phi, then press the 'Enter' key.\n\n";<br />
cin>>p;<br />
<br />
a(p);<br />
b(p);<br />
c(p);<br />
d(p);<br />
e(t);<br />
f(t);<br />
g(t);<br />
h(t);<br />
<br />
printarray(dip_array);"\n.";<br />
printarray(azim_array);<br />
printarray(lambda_array);<br />
<br />
return 0;<br />
}<br />
<br /> Please help
|
|
|
|
|
your global variables are not initialized when you initialize your arrays. Then your arrays are initialized on the stack before your main function is called. Inside of your code, you never assign any values to the arrays afterwards.
What you should do, is simply move your array initialization after you call all of your functions a-h, then values will be assigned into your arrays.
Good luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thank you, Paul. This worked perfectly.
|
|
|
|
|
New Problem: Now I'm doing the multiplication, where I'm trying to multiply the arrays in this order:
<br />
lambda_array*dip_array*azim_array*r_array<br />
what am i doing wrong? all my values in the final range array, fr_array are all zero, which shouldn't be the case...
Here's the code.
<br />
<br />
#include <math><br />
#include "stdafx.h"<br />
#include <iostream><br />
using namespace std;<br />
<br />
double theta, phi, t, p;
double lambda1 = 0.5;<br />
double lambda2 = 2;<br />
double a11,a12,a21,a22,d11,d13,d31,d33;<br />
const double pi = 3.142857;<br />
const int rows = 3;<br />
const int cols = 3;<br />
<br />
double dip_array [3][3] = {0}; <br />
<br />
double azim_array [3][3] = {0}; <br />
<br />
double lambda_array [3][3] = {0}; <br />
<br />
double r_array [3] = {0};<br />
<br />
double fr_array [3][3] = {0}; <br />
<br />
<br />
double a(double p)<br />
{<br />
d11 = cos((p*pi)/180);<br />
return d11;<br />
}<br />
<br />
double b(double p)<br />
{<br />
d13 = -1*sin((p*pi)/180);<br />
return d13;<br />
}<br />
<br />
double c(double p)<br />
{<br />
d31 = sin((p*pi)/180);<br />
return d31;<br />
}<br />
<br />
double d(double p)<br />
{<br />
d33 = cos((p*pi)/180);<br />
return d33;<br />
}<br />
<br />
<br />
double e(double t)<br />
{<br />
a11 = sin((t*pi)/180);<br />
return a11;<br />
}<br />
<br />
double f(double t)<br />
{<br />
a12 = cos((t*pi)/180);<br />
return a12;<br />
}<br />
<br />
double g(double t)<br />
{<br />
a21 = -1*cos((t*pi)/180);<br />
return a21;<br />
}<br />
<br />
double h(double t)<br />
{<br />
a22 = sin((t*pi)/180);<br />
return a22;<br />
}<br />
<br />
<br />
void printarray (double arg[][3]) <br />
{<br />
for (int i=0; i<rows; i++)
{<br />
for (int j=0; j<cols; j++)
cout << arg[i][j] << " ";<br />
cout << "\n";<br />
}<br />
}<br />
<br />
void printarray2(double arg[]) <br />
{<br />
for (int i=0; i<rows; i++)
{<br />
cout << arg[i] << " ";<br />
cout << "\n";<br />
}<br />
}<br />
<br />
void mult(double fr_array[3][3])<br />
{<br />
for(int i=0;i<rows;i++)
{<br />
for(int j=0;j<cols;j++)
{<br />
for(int k=0;k<cols;k++)
{<br />
for(int l=0;l<cols;l++)
{<br />
fr_array [i][j] += lambda_array [i][l]*dip_array [l][k]*azim_array[k][j];<br />
fr_array [i][j] += fr_array[i][j]*r_array[i];<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
<br />
cout<<"ANISOTROPY MODELLING.\n";<br />
cout<<"\nPlease enter a real number between 0 and 360 for the azimuth angle, theta, then press the 'Enter' key.\n\n";<br />
cin>>t;<br />
<br />
cout<<"\nPlease enter a real number between 0 and 360 for the dip angle, phi, then press the 'Enter' key.\n\n";<br />
cin>>p;<br />
<br />
a(p);<br />
b(p);<br />
c(p);<br />
d(p);<br />
e(t);<br />
f(t);<br />
g(t);<br />
h(t);<br />
<br />
double dip_array [3][3] = {{d11,0,d13},{0,1,0},{d31,0,d33}}; <br />
<br />
double azim_array [3][3] = {{a11,a12,0},{a21,a22,0},{0,0,1}}; <br />
<br />
double lambda_array [3][3] = {{lambda1,0,0},{0,1,0},{0,0,lambda2}}; <br />
<br />
double r_array [3] = {4,8,3.94};<br />
<br />
<br />
<br />
cout<<"\nThe dip array is:\n";<br />
printarray(dip_array);<br />
<br />
cout<<"\nThe azimuth array is:\n";<br />
printarray(azim_array);<br />
<br />
cout<<"\nThe anisotropy array is:\n";<br />
printarray(lambda_array);<br />
<br />
cout<<"\nThe original range array is:\n";<br />
printarray2(r_array);<br />
<br />
<br />
mult(fr_array);<br />
cout<<"\nThe final range array is:\n";<br />
printarray(fr_array);<br />
<br />
<br />
<br />
return 0;<br />
}
You can use 60 degrees for theta and phi, for check, since cos(60) = 0.5, sin(60) = 0.866....
|
|
|
|
|