|
That worked perfectly. Thank you so much!
Thanks,
Carla
|
|
|
|
|
Is it posible to draw on two monitors, perfect synchronously ? I had taked from here[^] an good example of how can I handle two monitors, but if I want to draw something on them, the drawing is no synchronously ... could you guide me in order to do that ?
Thank you.
|
|
|
|
|
Even with two threads running it is impossible to guarantee exact synchronous actions.
|
|
|
|
|
And how would you synchronize the hardware refresh period? I would drop this idea.
|
|
|
|
|
I didn't put this problem, my goal is to draw the same image, on two monitors, in the same time, at leat to begin to draw the same image in the same time. Any idea will be welcomed.
|
|
|
|
|
Hi,
I am developing a MFC application on Windows 8.1 using VS-2005.
Requirement is to customize Folder Explorer for a specific purpose. I want to create own pidl for folder and its contents.
When I will open a particular folder, application's should inherit Win-8 Windows explorer.
I want to set customized icon for folder on top left corner(On Win-8) and at the root of address bar.
I am using GetBindToObject, GetUIObjectOf, CreateViewObject, GetIconLocation and Extract method in ShellFolderImpl class. Please give me some sample source code or idea to do that. I have already studied URL - [http://msdn.microsoft.com/en-us/library/windows/desktop/cc144093%28v=vs.85%29.aspx ] but it is not working.
This method is in ShellFolderImpl class
BindToObject, CreateViewObject, etc functions are working correctly.......
Icon index and Icon is loaded correctly. bcz I saved created icon from Extract method.
But emplty icon is placed at specified place on folder as given in above image.
1. IExtractIcon interface is called from GetUIObjectOf method correctly.
2. GetIconLocation method gives correct output Index for Icon.
3. Extract function gives correct output for hIcon.
But problem is that Icon assigned to displayed was not correctly displayed at AddressBar and Caption Bar(Top-left corner).
Currently, Icon is displayed on AddressBar and Caption Bar(Top-left corner) was empty file icon.
when I set :
HRESULT ExtIcon::ExtractImpl(UINT nIconIndex, HICON* phiconLarge, HICON* phiconSmall)
{
phiconLarge = NULL;
phiconSmall= NULL;
}
I got folder icon on the AddressBar and Caption Bar.
--------------------------------------------------------------------------------------
STDMETHODIMP ShellFolderImpl::GetUIObjectOf ( HWND , UINT uCount,
LPCITEMIDLIST* pPidl, REFIID riid,
LPUINT, void** ppvReturn )
{
try
{
*ppvReturn = NULL;
if( uCount != 1 )
return E_FAIL;
if( IsEqualIID(riid, IID_IExtractIconA)|| IsEqualIID(riid, IID_IExtractIconW))
{
CComObject<ExtIcon>* pExtractIcon;
HRESULT hr = CComObject<ExtIcon>::CreateInstance ( &pExtractIcon );
if (FAILED(hr))
return hr;
pExtractIcon->Init(GetUnknown());
pExtractIcon->AddRef();
pExtractIcon->SetMyPIDL((LPITEMIDLIST)*pPidl);
hr = pExtractIcon->QueryInterface(riid, ppvReturn);
pExtractIcon->Release();
return hr;
}
catch(...){}
return E_NOINTERFACE;
}
Extract Icon handler is as :
#pragma once
#include "resource.h"
#include "PluginRes.h"// main symbols
#include "pidlmgr.h"
#include "ExplorerPlugIn.h"
class ATL_NO_VTABLE ExtIcon :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<ExtIcon, &CLSID_ExtIcon>,
public IDispatchImpl<IExtIcon, &IID_IExtIcon, &LIBID_ExplorerPlugInLib, 1, 0>,
public IExtractIconA,
public IExtractIconW
{
public:
ExtIcon()
{
}
ExtIcon(LPCITEMIDLIST pidl);
DECLARE_REGISTRY_RESOURCEID(IDR_EXTICON)
BEGIN_COM_MAP(ExtIcon)
COM_INTERFACE_ENTRY_IID(IID_IExtractIconA, IExtractIconA)
COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW)
COM_INTERFACE_ENTRY(IExtIcon)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease()
{
}
public:
STDMETHOD(GetIconLocation)(THIS_ UINT, LPSTR, UINT, int* piIndex, UINT* pwFlags)
{
return GetIconLocationImpl(piIndex, pwFlags);
}
STDMETHOD(Extract)(THIS_ LPCSTR, UINT nIconIndex, HICON* phiconLarge, HICON* phiconSmall, UINT)
{
return ExtractImpl(nIconIndex, phiconLarge, phiconSmall);
}
STDMETHOD(GetIconLocation)(THIS_ UINT, LPWSTR, UINT, int* piIndex, UINT* pwFlags)
{
return GetIconLocationImpl(piIndex, pwFlags);
}
STDMETHOD(Extract)(THIS_ LPCWSTR, UINT nIconIndex, HICON* phiconLarge, HICON* phiconSmall, UINT)
{
return ExtractImpl(nIconIndex, phiconLarge, phiconSmall);
}
void Init(IUnknown *pUnkOwner);
void SetMyPIDL(LPITEMIDLIST pidl)
{
m_pidl = pidl;
}
enum BoxType
{
PUBLIC,
PRIVATE
};
private:
HRESULT GetIconLocationImpl(int*, UINT*);
HRESULT ExtractImpl(UINT, HICON*, HICON*);
CPidlMgr* m_pPidlMgr;
LPITEMIDLIST m_pidl;
BOOL m_bIsOpenIcon;
protected:
CComPtr<IUnknown> m_UnkOwnerPtr;
DWORD m_ObjRefCount;
};
OBJECT_ENTRY_AUTO(__uuidof(ExtIcon), ExtIcon)
modified 11-Apr-14 8:01am.
|
|
|
|
|
Dear all:
I implement a application, when I get a touch data from WM_INPUT and touch count more than previous, it will play sound, My code show as below:
void CTouchSoundTrayDlg::OnRawInput(UINT nInputCode, HRAWINPUT hRawInput)
{
UINT data_size = 0;
BOOL bGot = FALSE;
GetRawInputData(hRawInput, RID_INPUT, NULL, &data_size, sizeof(RAWINPUTHEADER));
vector<BYTE> data;
data.resize (data_size);
if(GetRawInputData (hRawInput, RID_INPUT, &data [0], &data_size, sizeof(RAWINPUTHEADER))!=data_size)
{
}
RAWINPUT* raw = (RAWINPUT*)(&data [0]);
if (raw->header.dwType == RIM_TYPEHID)
{
RID_DEVICE_INFO device_info;
UINT info_size = sizeof(RIDI_DEVICEINFO);
GetRawInputDeviceInfo ( raw->header.hDevice, RIDI_DEVICEINFO, (LPVOID)&device_info,&info_size);
if(device_info.hid.dwVendorId = VENDER_ID)
{
g_CurFrameTime = GetTickCount64();
if(g_CurFrameTime - g_PreFrameTime > 30)
{
g_PreUsedSize = 0;
g_CurUsedSize = 0;
}
g_PreFrameTime = g_CurFrameTime;
DigitizerData* result = (DigitizerData*)(raw->data.hid.bRawData);
g_CurUsedSize = result->active_touch_count;
if(g_CurUsedSize <= 5)
{
if(g_PreUsedSize < g_CurUsedSize)
{
PlaySound(m_WavPath, NULL, SND_FILENAME|SND_ASYNC );
}
bGot = TRUE;
}
if(bGot)
{
g_PreUsedSize = g_CurUsedSize;
}
}
}
Default();
}
My question is
when I touch, it will play sound, and the using memory in task manager will be add, When play music is finish, the using memory is still, will not free
,why?
I try to disable the playSound api in my code, and the using memory is stable.
Thank your help, Victor
|
|
|
|
|
I would assume that data structures are initialized to play the sound, and then the data structures are kept for the next sound to play.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi,
I am trying to rewrite an old VC++ wrapper class around MS Word Automation - it used to use *.tli and *.tlh files, but now MS recommends just using the *.h files which get generated. So, that is another level of complexity.
So, I got so far, now I am wondering what to do next.
Here are some code snips, the real code obviously has error correction etc., so here is what I have so far;
IDispatch *pWordInst;
CApplication *pWordApp;
CDocument0 *pDoc;
IUnknown *pUnknown;
HRESULT res = CoInitialize(NULL);
CLSID clsid;
HRESULT hr = CLSIDFromProgID(L"Word.Application", &clsid);
hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void **)&pWordInst);
pUnknown = NULL;
REFIID iid2 = __uuidof(IUnknown);
hr = pWordInst->QueryInterface(iid2, (void **)&pUnknown);
So, now I need to get the Application and Document objects (assuming that this code creates a new document as it used to).
I am guessing I need a getApplication() but what MS class do I use for that?
Once I have the Application, then I can get the Document, presumably with a get_Documents() or get_ActiveDocument()?.
After that I guess it will run like my older version used to.
Any help and advice would be great.
Many Thanks,
Bryan.
|
|
|
|
|
|
I've always done it like:
_Application app;
Documents docs;
_Document doc;
if (app.CreateDispatch("Word.Application") == TRUE)
{
docs = app.GetDocuments();
doc = docs.Open(COleVariant(strFileName), ...);
docs.Close(vtFalse, vtOptional, vtOptional);
app.Quit(vtOptional, vtOptional, vtOptional);
} Not sure if that helps you or not.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
We were given a task to use lists and iterators. We were supposed to make them from scratch. I'm done with that. The problems that I'm having are as following:
1. I'm not able to access the list made of Course datatype which is present in each Student instance. Does this mean I need to make an iterator for that course list inside the student class?
2. Similarly since I don't have direct access to The course list so I added the course into the Student list through the student objects not through the iterator. How can I do it through the iterator?
3. Printing of a particular student and his courses is not happening as my iterator made for student only prints out the students, not the courses present in their courselist. How to do that?
Here's the code:
<pre lang="c++">
#include <iostream>
#include <string>
using namespace std;
const int ILLEGAL_SIZE = 1;
const int OUT_OF_MEMORY = 2;
const int NO_SPACE = 3;
const int ILLEGAL_INDEX = 4;
const int ILLEGAL_REFERNCE = 5;
const int COURSE_LIMIT_REACHED = 6;
template <class T>
class ListIterator;
template <class T>
class OrderedList {
friend class ListIterator<T>;
private:
int maxSize;
int currentSize;
T *listArray;
bool removeAt(int index) {
if(index < 0 || index >= currentSize) throw ILLEGAL_INDEX;
else {
for(int i=index;i<currentSize;i++)
listArray[i] = listArray[i+1];
currentSize--;
return true;
}
}
public:
OrderedList(int size);
OrderedList(const OrderedList& copy);
~OrderedList();
void setData(T s);
T getData(int i);
int getCurrent() { return currentSize; }
bool isFull();
bool isEmpty();
int isPresent(T value);
void insert(T value);
bool remove(T value);
int search(T value);
void printData();
const OrderedList& operator = (const OrderedList& assignment);
};
template <class T>
OrderedList<T>::OrderedList(int size) {
if(size < 0) throw ILLEGAL_SIZE;
maxSize = size;
listArray = new T[maxSize];
if(listArray == NULL) throw OUT_OF_MEMORY;
currentSize = 0;
}
template <class T>
OrderedList<T>::OrderedList(const OrderedList& copy) {
maxSize = copy.maxSize;
currentSize = copy.currentSize;
listArray = new T[maxSize];
for(int i=0;i<currentSize;i++) {
listArray[i] = copy.listArray[i];
}
}
template <class T>
const OrderedList<T>& OrderedList<T>::operator= (const OrderedList& assignment) {
if(this != &assignment) {
currentSize = assignment.currentSize;
delete [] listArray;
listArray = new T[maxSize];
for(int i=0;i<currentSize;i++) {
listArray[i] = assignment.listArray[i];
}
}
return *this;
}
template <class T>
OrderedList<T>::~OrderedList() {
delete [] listArray;
}
template <class T>
void OrderedList<T>::setData(T s) {
listArray[currentSize] = s ;
currentSize++;
}
template <class T>
T OrderedList<T>::getData(int i) {
return listArray[i];
}
template <class T>
bool OrderedList<T>::isEmpty() {
return (currentSize == 0);
}
template <class T>
bool OrderedList<T>::isFull() {
return (currentSize == maxSize);
}
template <class T>
int OrderedList<T>::isPresent(T value) {
return(search(value));
}
template <class T>
int OrderedList<T>::search(T value) {
int low = 0;
int mid;
int high = currentSize-1;
while(low<=high) {
mid = (low + high)/2;
if(value == listArray[mid])
return mid;
else if(value > listArray[mid])
low = mid + 1;
else
high = mid - 1;
}
return -1;
}
template <class T>
void OrderedList<T>::insert(T value) {
if(isFull()) throw NO_SPACE;
else {
int i = currentSize;
while( i > 0 && value < listArray[i-1]) {
listArray[i] = listArray[i-1];
i--;
}
listArray[i] = value;
currentSize++;
}
}
template <class T>
bool OrderedList<T>::remove(T value) {
int index = search(value);
if(index == -1) return false;
else {
return removeAt(index);
}
}
template <class T>
void OrderedList<T>::printData() {
for(int i=0;i<currentSize;i++) {
cout << listArray[i] << endl;
}
}
class Course {
private:
string ID;
double GPA;
public:
Course(): ID(""),GPA(0) {}
Course(string id,double gpa): ID(id),GPA(gpa) {}
double getGPA() { return GPA; }
void printCourse() { cout << "Course ID: " << ID << " " << "GPA: " << GPA << endl; }
friend ostream& operator<< (ostream & out, const Course& course) { out << course.ID << " " << course.GPA << endl; return out; }
bool operator< (Course c) { if (ID < c.ID) return true; else return false; }
bool operator> (Course c) { if (ID > c.ID) return true; else return false; }
bool operator== (Course c) { if (ID == c.ID) return true; else return false; }
};
class Student {
private:
string name;
int rNo;
int noOfCourses;
double CGPA;
OrderedList<Course> courseList;
public:
Student(): name(),rNo(0),CGPA(0),noOfCourses(0),courseList(50) {}
Student(string n,int r): name(n),rNo(r),CGPA(0),noOfCourses(0),courseList(50) {}
void printStudent() { cout << "Name : " << name << " " << "Roll No: " << rNo << " " << "CGPA: " << CGPA << endl; if(noOfCourses !=0) printCourse(); }
int getRoll() { return rNo; }
void addCourse(Course c) {
if(noOfCourses < 50) {
courseList.insert(c);
noOfCourses++;
}
else throw COURSE_LIMIT_REACHED;
}
void removeCourse(Course c) {
if(noOfCourses != 0){
courseList.remove(c);
noOfCourses--;
}
else cout << "There are no Courses to be removed\n" << endl;
}
void printCourse() { cout << "Courses Taken\n\n"; courseList.printData(); }
double calCGPA() {
Course c;
double sum = 0;
for(int i=0;i<noOfCourses;i++){
c = courseList.getData(i);
sum = sum + c.getGPA();
}
CGPA = sum/noOfCourses;
return CGPA;
}
friend ostream& operator<< (ostream& out, const Student& student) { out << student.name << " " << student.rNo << endl; return out; }
bool operator <(Student s) { if (rNo < s.rNo) return true; else return false; }
bool operator >(Student s) { if ( rNo > s.rNo) return true; else return false; }
bool operator ==(Student s) { return (rNo == s.rNo); }
};
template <class T>
class ListIterator {
private:
OrderedList<T> &list;
int current;
ListIterator & operator =(const ListIterator & rhs);
public:
ListIterator(OrderedList<T> &l): list(l), current(0) { }
ListIterator(const ListIterator<T> &li): list(li.list), current(li.current) { }
void begin(){ current = 0; }
int getCurrent() { return current; }
void end() { current = list.currentSize; }
bool isStart() { return current == 0; }
bool isDone() { return current == list.currentSize; }
void next() {
if (!isDone()) current++;
else throw ILLEGAL_REFERNCE;
}
bool find(const T key) {
current = list.search(key);
if (current > -1) return true;
else return false;
}
T getData() { return (list.listArray[current]); }
void setData(const T value) { list.listArray[current]; }
void insertData(T value) { list.insert(value); }
void removeData(T value) { list.remove(value); }
void getCourse(Student s) { getCourse(s); }
void printData() { list.printData(); }
};
int main() {
OrderedList<Student> studentList(10);
Student s1("Hamza",12105092);
Student s2("Ahmad",12105081);
Student s3("Sherlock",12105032);
Student s4("Watson",12134989);
Student s5("Gary",12105042);
Student s6("Ali",3111111);
ListIterator<Student> studentIterator(studentList);
studentIterator.insertData(s1);
studentIterator.insertData(s2);
studentIterator.insertData(s3);
studentIterator.insertData(s4);
studentIterator.insertData(s5);
studentIterator.printData();
cout << endl;
studentIterator.removeData(s1);
cout << "List After Removing A Student\n" << endl;
studentIterator.printData();
cout << endl;
Course c1("CS102",3.44);
Course c2("CS101",3.11);
Course c3("MATH101",4);
s5.addCourse(c1);
s5.addCourse(c2);
s5.addCourse(c3);
studentIterator.setData(s5);
s5.removeCourse(c2);
cout << "After removing a course\n" << endl;
s5.printStudent();
bool store;
string name;
int rollNo;
cout << "Enter The Student's Name and Roll Number To Find If He's Present In The List\n";
cin >> name;
cin >> rollNo;
Student s7(name,rollNo);
store = studentIterator.find(s7);
if(!store) cout << "Student is not present in the list\n" << endl;
else cout << "Student is present\n" << endl;
s5.calCGPA();
s5.printStudent();
int index = 0;
cout << endl;
cout <<"Enter the Student's name and Roll No. Whose Course Details You Want To Know" << endl;
cin >> name;
cin >> rollNo;
Student s9(name,rollNo);
store = studentIterator.find(s9);
if(store)
cout << studentIterator.getData();
else
cout <<"Entered Roll Number Isn't Present In The List" << endl;
studentList.printData();
return 0;
}
|
|
|
|
|
IMO, You should insert into a list, not in to an iterator.
The iterator is (only) used for traversing the list; have a look at what STL does, the container is std::vector and its iterator is std::vector::iterator.
Ok, to answer the questions:
1. Yes, there should be a method (private) inside the Student class to iterator over the course.
2. the printCourse method should iterator over the courseList list.
3. the studentList should not have a "printData"; just iterate over over the Student and call printCourse for each student in the list.
...
YMMV
Good luck.
Max.
I'd rather be phishing!
|
|
|
|
|
Please see #4 here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I have a console application which calculates using formulas based on the inputs it is receiving every cycle in a particular frequency and gives dynamic output values based on its input variables and constants and so on. In short its a real time application.
This application was initially developed in Visual Studio 6.0 as c++ console application. Recently we converted it to Visual Studio 2008.
It was working fine in VS 6.0. But after conversion, some of the values shows -1.#J which seems like infinite values.
When I observed, it seems like certain calculations may result in divide by 0 or complex values like square root of a negative number and these values should show the value as -1.#J.
But I wonder how there was no such values in VS6.0 whereas VS2008 shows these junk values.
Please suggest me some ways of preventing it.
modified 10-Apr-14 7:56am.
|
|
|
|
|
Please show your code.
Everything is the code !
|
|
|
|
|
Please show your code.
Everything is in the code !
|
|
|
|
|
I am posting one of the functions used in the code. There are many functions similar to this in the entire application
int CONDENSER(float Fl,float Fv,float Rc,float Gain,float DesFp,float Htcfl,
float Htcmaxfl,float Tflsh,float Fc, float Cpcw,
float Cppl, float Cppv, float Cpov,float Cpol, float DesFc,
float Tcwi,float Tpfi,float Tc,float Lhpv,float Lhv,
float Condeff,float CondHtarea,float Ambhc,
float Ambhf, float Ambt,float Mhc, float Mhf,
float Tfmax, float Tcmax,float *Liquid, float *Vapor,int IL, int IV,int OV, int OL,int FN,int CN)
{
int J,N,K,TYPE;
float Fp,SYCOMP,SXCOMP,Heatin,Heatvap,Heatliq;
float Heatloss,Hg,Hc,DELT1,DELT2,A,B,DENOM,DELT,Heatout;
float DER,MAX,MIN,FLAG,P,I,PI;
// Amount of Vapor condensed [ L = ( 1 - V/F) * F ]
Fp = Fl + Fv;
*Liquid = Rc * Fp;
// By material balance
*Vapor = Fp - (*Liquid);
// Composition of Vapor in equilibrium with Liquid Y = K * X
SYCOMP = 1.0E-10;
for(J=Esim->COMPBEG;J<=Esim->COMPEND;J++)
{
Esim->SCOMP[J][OV] = Esim->NKVAL[J][FN]*Esim->NXS[J][FN];
SYCOMP = SYCOMP + Esim->SCOMP[J][OV];
}
// Condensation rate (PI Logic)
Esim->NS1DER[FN]= 1 - (SYCOMP);
P = Gain*Esim->NS1DER[FN];
I = Esim->NS1S[FN];
I = LIMIT01(I+Esim->NODEK7[FN]*Esim->NS1DER[FN]);
PI = LIMIT01(P+I);
Esim->NS1S[FN] = LAG(PI,Esim->NS1S[FN],0.05);
Esim->NS1S[FN] = LIMIT01(Esim->NS1S[FN]);
// Condensed Liquid Composition
// FEED * Yi - VAP * Yi - LIQ * Xi = ACC * (d(Xi)/dt)*dt
// d(Xi) = (FEED * Yi - VAP * Yi - LIQ * Xi)/(ACC * dt)
SXCOMP = 1.0E-10;
for(J=Esim->COMPBEG;J<=Esim->COMPEND;J++)
{
Esim->SCOMP[J][OV] = Esim->SCOMP[J][OV]/SYCOMP;
Esim->NXDER[J][FN] = (Fl*Esim->SCOMP[J][IL]+Fv*Esim->SCOMP[J][IV] -(Fv)*Esim->NXS[J][FN]
-(Fl)*Esim->NXS[J][FN])/(10 + MAXI(Fp-(*Vapor),100.0)
*Esim->STPSIZEH/10000);
Esim->NXS[J][FN] = EULER( N, K, TYPE, DER, MAX, MIN, FLAG);
SXCOMP = SXCOMP + Esim->NXS[J][FN];
}
for(J=Esim->COMPBEG; J<=Esim->COMPEND; J++)
{
Esim->NXS[J][FN] = Esim->NXS[J][FN]/SXCOMP;
Esim->SCOMP[J][OL] = Esim->NXS[J][FN];
}
Hg = power((Fp/DesFp),0.5);
// Efficiency of the condenser
Esim->NS2[FN] = Condeff*MAXI(Htcfl*Hg,Htcmaxfl);
Esim->NHTR[FN] = Esim->NS2[FN]*(Tflsh - Tc);
if(Fc>0) // Cooling water side calculations
{
// From McCabe & Smith h=K*(Fc)**(-1/3)
Hc = power((Fc/DesFc),-0.33);
// Accounting for the overall Heat transfer coefficient
// 1/U = 1/Hg + 1/Hc
Esim->NS2[FN] = Condeff*CondHtarea*(Hg * Hc)/(Hg + Hc);
// Energy balance across the cooling node to find out temperature
// F*CP*(I/T-AMB)+HTRAN-F*CP*(O/T-AMB)-HLOSS = ACC*CP*(dT/dt)*dt
Esim->NTDER[CN]=(Heatin-Heatout)/(Mhc*Cpcw*Esim->STPSIZEH/10000);
} // Cooling water side calculations
Esim->STEMP[OV] = Esim->NTEMP[FN];
Esim->STEMP[OL] = Esim->NTEMP[FN];
Esim->SMFLOW[OV] = *Vapor;
Esim->SMFLOW[OL] = *Liquid;
return 0;
}
modified 10-Apr-14 8:26am.
|
|
|
|
|
Firstly, please indent your code properly and use <pre> tags around it so that it is readable, like:
for(J = Esim->COMPBEG; J <= Esim->COMPEND; J++)
{
Esim->SCOMP[J][OV] = Esim->SCOMP[J][OV]/SYCOMP;
Esim->NXDER[J][FN] = (Fl*Esim->SCOMP[J][IL]+Fv*Esim->SCOMP[J][IV] -(Fv)*Esim->NXS[J][FN]
-(Fl)*Esim->NXS[J][FN])/(10 + MAXI(Fp-(*Vapor),100.0)
*Esim->STPSIZEH/10000);
Esim->NXS[J][FN] = EULER( N, K, TYPE, DER, MAX, MIN, FLAG);
SXCOMP = SXCOMP + Esim->NXS[J][FN];
}
Secondly, please indicate exactly where the error occurs, and show the values of the inputs at the time.
|
|
|
|
|
You don't want to do that, you want to avoid device by zero period. If you don't know why, go back to school.
"The whole idea that carbon dioxide is the main cause of the recent global warming is based on a guess that was proved false by empirical evidence during the 1990s." climate-models-go-cold
|
|
|
|
|
One possible reason of many is that in the original (vc++ 6) structured exception handling was enabled and now it isn't. This would mean that divide by 0 exceptions were being thrown but not being caught (possibly). Now they are just crashing the program.
Unhandled divide by zero is bad so don't worry about why it did/did not. Just fix the problem now. Structured exception handling is a very good way of doing that.
Peter Wasser
"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." - Bertrand Russell
|
|
|
|
|
Hello there,
I am using CDHtmlDialog in my MFC application to create a UI with HTML, CSS & JavaScript.
In my project there's one dialog created from CDHtmlDialog and a corresponding HTML file for that dialog.
Now during run time i want to change the contents of the HTML file.
Not just the HTML part, i want to change the CSS & JavaScript too.
So basically what am trying to do is, change the entire content of the default HTML file.
Is this possible? If yes, how can i do that?
Thanks in advance!
|
|
|
|
|
I have a static control area, it is about 4 lines height.
if I only have one string to display, How can I make it horizontal and vertical center?
Thanks
|
|
|
|
|
|
For the horizontal center, use SS_CENTER, there is not vertical center for CStatic ( or Cedit), you will have to do it manually.
I'd rather be phishing!
|
|
|
|
|