|
After converting my project from VC6.0 to VS2008.Im getting continouly error.I dont have error in building the exe.
When im running this exe i got lot of errors.Mostly on System.AccessViolation,System.NullRefernceException like this.Now i get
An unhandled exception of type 'System.NullReferenceException' occurred in InstructorStation.exe
Additional information: Object reference not set to an instance of an object.
error in this fucntion.
void CMainFrame::UpdateOprs(CTrans *pData)
{
IsNewOpr = TRUE;
WriteDebug("UpdateOprs() - Begin");
.
.
}
THis function get called as follow
CTrans tData;
CMainFrame* tFrm = (CMainFrame*)AfxGetMainWnd();
for(i=0;i<LiveDataCount.Count;i++)
tData.m_sData.Insert(i,LiveArray[i]);
tFrm->UpdateOprs(&tData);
Whats the problem in converting?I thought converting project should be simple likethat.I don't know whether i did any wrong?
Pls guide me on this issue.
Anu
|
|
|
|
|
CMainFrame* tFrm,
what is the value of tFrm?
Did u check whether it is 0 or not?
Please check
if( 0 != frm )
Величие не Бога может быть недооценена.
|
|
|
|
|
While debugging,when i keep mouse on tFrm,it shows as undefined value.
Anu
|
|
|
|
|
Please change your optimization in project settings to see the value of the variable.
Величие не Бога может быть недооценена.
|
|
|
|
|
Sorry,what can i change?
properties->configuratio properties->c/c++->optimization->optimization: Custom
Shall i change to Fulloptimization(/Ox)
Anu
|
|
|
|
|
Now i use tFrm as follow
CMainFrame* tFrm;
tFrm = new CMainFrame();
now that problem is not coming.
Anu
|
|
|
|
|
Hi. I need a program solving the running time of depth first search algorithm..I'm trying to solve it but its hard for me to come up with the solution.
Is it possible to integrate the backtracking in breadth first search algorithm?
If so, can you give me any program for this with computation of its running time ??
I really appreciate any response to this..
Thnx..
|
|
|
|
|
Dear friend, this forum is to help to solve your technical problem, no one is here to spoon feed you.
So don't ask for the whole program again in this forum.
And please read the the instruction, how to ask questions [^]
Please check with this link, it will help you related to DFS [^]
Величие не Бога может быть недооценена.
modified on Wednesday, December 23, 2009 4:19 AM
|
|
|
|
|
The running time of the depth first search algorithm is O(n) where n is the number of nodes in your graph.
Breadth-first search avoids backtracking, and also has a running time of O(n).
You can find programs for both of these algorithms through Google.
|
|
|
|
|
my questions:
how to implement draging for the system icons,just like My Computer,My Document and etc, into other directories in my own design app.as i know,exploer just create a icon-link for the operations,how can i emulate this operation, thank you very much.
your little brother
|
|
|
|
|
Do u want to get drag and drop of files into your application?
Величие не Бога может быть недооценена.
|
|
|
|
|
i want to create a shortcut for my computer in my own application
|
|
|
|
|
|
|
Hi There.
My problem is:
I am able to send messages to the queue using my machines name, but am unable to do the same with IP Add.
For example:
qInfo->PathName = "MYCOMPUTER\\private$\\PanBQueue"; works fine...
qInfo->PathName = "IP ADDRESS\\private$\\PanBQueue"; Fails...
Thanks
PanB
|
|
|
|
|
Did you check the error you are getting?
Please check that first?
Величие не Бога может быть недооценена.
|
|
|
|
|
I do not get any error message as such. But when I try to open the queue...i.e.,
qDest = qInfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE);
I got an exception. Please let me know, in case you need any further details.
Thanks anyway for your effort.
|
|
|
|
|
Please tell me whats the exception?
And i hope u checked the getLastError [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
catch(_com_error &e)
e.Source() -> MSMQQueueInfo
e.Description() -> The queue path name specified is invalid.
|
|
|
|
|
I think you are using MQPathNameToFormatName,
if so then DNS name is correct. It wont accept IPAddress.
So i think, firstly IP address should be changed to corresponding DNS name [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
More info:
I want to place a message from MachineA to MachineB's Message Queue.
So, I have to access the message queue on MachineB using its IP Address itself.
Any pointers/suggestions will be highly appretiated.
Thanks.
|
|
|
|
|
As i suggested earlier, get the DNS name from IPadress using gethostbyaddr API [^]
And then pass DNS name with the path. Now your problem solved,isn't it?
Величие не Бога может быть недооценена.
modified on Wednesday, December 23, 2009 11:43 PM
|
|
|
|
|
Hi all,
I am new to the C Programming. Currently, I am using the 3-axis accelerometer MMA7260QT, P18F2620 and GSM Module iWOW TR 900 for my project.
MMA7260QT
MMA7260QT is the accelerometer that detect the 3-axis: X, Y and Z-axis.
P18F2620
P18F2620 is used to detect the acceleration signal sent by MMA7260QT in 3-axis. Once there is a vibration, it will automatically retrieve the Cell-ID. Then, it will convert the Cell-ID into the decimal form and send out to GSM Module iWOW TR900.
iWOW TR 900
iWOW TR 900 is to get whatever info from P18F2620 and send out using GSM.
The objective of my project is to detect the acceleration in 3 axis.
Once there is the vibration, it will send the signal to the P18F2620. P18F2620 will then automatically retrieve the Cell ID, convert it into the decimal form, eg. 15322-32 to be send out via SMS.
I have write the simple C code to send the fixed Cell ID. I have tested my program. It is able to send the fixed Cell ID out. However, there is something wrong with my codes. Firstly, it is still unable to detect the acceleration. Secondly, I still unable to write the code to get the Cell ID automatically. The iWOW module is only recognised AT command.
I am using the AT+CREG=2 and AT+CREG? in order to get the Cell ID. The reply on the hyper terminal is like this.
AT+CREG=2
OK
AT+CREG?
+CREG: 2,1,"0020","DB27"
I will need to store the 0020 and DB20 (Hex form) and convert it into decimal form 56103-32 to be sent out using the GSM module. All these have to be done using C program.
Here is my code snippet. Please correct me if anything I wrote wrongly in my code. Thanks
#include <P18f2620.h>
#include <delays.h>
#include <adc.h>
#define PWON PORTCbits.RC0
#define RESET PORTCbits.RC1
void InterruptHandlerHigh(void);
void adc_accelerometer(void);
char MESS[12] = {"AT+CREG=2\r\n"};
char MESS1[11] = {"AT+CREG?\r\n"};
char MESS2[12] = {"AT+CMGF=1\r\n"};
char MESS3[22] = {"AT+CMGS=+6512345678\r\n"};
char MESS4[21] = {"CellID | 15831-32\n\x1A"};
unsigned char a,b,i,j,k,l,m,x;
int X,Y,Z,X1,Y1,Z1;
#pragma code InterruptVectorHigh = 0x08
void InterruptVectorHigh(void){
_asm
goto InterruptHandlerHigh
_endasm
}
#pragma code
#pragma interrupt InterruptHandlerHigh
void InterruptHandlerHigh()
{
if(INTCON3bits.INT1IF==1)
{
if((X1+15<X<X1-15) | (Y1+15<Y<Y1-15) | (Z1+15<Z<Z1-15))
{
Delay10KTCYx(200);
i=0, j=0, k=0, l=0, m=0;
while (MESS[i])
{
while(!TXSTAbits.TRMT);
TXREG=MESS[i];
i++;
}
Delay10KTCYx(200);
while (MESS1[j])
{
while(!TXSTAbits.TRMT);
TXREG=MESS1[j];
j++;
}
Delay10KTCYx(200);
while (MESS2[k])
{
while(!TXSTAbits.TRMT);
TXREG=MESS2[k];
k++;
}
Delay10KTCYx(200);
while (MESS3[l])
{
while(!TXSTAbits.TRMT);
TXREG=MESS3[l];
l++;
}
Delay10KTCYx(200);
while (MESS4[m])
{
while(!TXSTAbits.TRMT);
TXREG=MESS4[m];
m++;
}
}
}
}
void main(void)
{
PWON = 1;
RESET = 1;
INTCONbits.GIEH = 0;
ADCON0=0b00000001;
ADCON1 = 0b00001100;
ADCON2 = 0b10000100;
TRISA = 0b00000111;
TRISC = 0b10111100;
SPBRG = 10;
TXSTA = 0b00100100;
RCSTA = 0b10010000;
RCONbits.IPEN =1;
INTCON3bits.INT1IP;
INTCON2bits.INTEDG2=1;
INTCON3bits.INT1IF=0;
INTCON3bits.INT1IE=1;
INTCONbits.GIE = 1;
for(x=0;x<1;x++)
{
Delay10KTCYx(200);
i=0, j=0, k=0, l=0, m=0;
while (MESS[i])
{
while(!TXSTAbits.TRMT);
TXREG=MESS[i];
i++;
}
Delay10KTCYx(200);
while (MESS1[j])
{
while(!TXSTAbits.TRMT);
TXREG=MESS1[j];
j++;
}
Delay10KTCYx(200);
while (MESS2[k])
{
while(!TXSTAbits.TRMT);
TXREG=MESS2[k];
k++;
}
Delay10KTCYx(200);
while (MESS3[l])
{
while(!TXSTAbits.TRMT);
TXREG=MESS3[l];
l++;
}
Delay10KTCYx(200);
while (MESS4[m])
{
while(!TXSTAbits.TRMT);
TXREG=MESS4[m];
m++;
}
}
while(1)
{
PORTA=~PORTA;
for(i=0;i<5;i++)
Delay10KTCYx(100);
Delay10TCYx( 5 );
ADCON0bits.GO=1;
while(ADCON0bits.DONE);
X1 = ADRESH*256+ADRESL;
ADCON0bits.ADON=0;
ADCON0=0b00000101;
Delay10TCYx( 5 );
ADCON0bits.GO=1;
while(ADCON0bits.DONE);
Y1 = ADRESH*256+ADRESL;
ADCON0bits.ADON=0;
ADCON0=0b00001001;
Delay10TCYx( 5 );
ADCON0bits.GO=1;
while(ADCON0bits.DONE);
Z1 = ADRESH*256+ADRESL;
ADCON0bits.ADON=0;
}
}
void adc_accelerometer(void)
{
Delay10TCYx( 5 );
ADCON0bits.GO=1;
while(ADCON0bits.DONE);
X = ADRESH*256+ADRESL;
ADCON0bits.ADON=0;
ADCON0=0b00000101;
Delay10TCYx( 5 );
ADCON0bits.GO=1;
while(ADCON0bits.DONE);
Y = ADRESH*256+ADRESL;
ADCON0bits.ADON=0;
ADCON0=0b00001001;
Delay10TCYx( 5 );
ADCON0bits.GO=1;
while(ADCON0bits.DONE);
Z = ADRESH*256+ADRESL;
ADCON0bits.ADON=0;
}
modified on Wednesday, December 23, 2009 6:39 AM
|
|
|
|
|
Please reformat your message with < pre > < /pre > tags, the chances that anyone reads your code more detailed and helps you will be higher.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
May I know why I need to reformat my message with
tags. Is it HTML?
|
|
|
|