|
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?
|
|
|
|
|
Please, read this[^]. Putting your code inside <pre></pre> tags will make it much more readable (now, your code is very hard to read).
|
|
|
|
|
I have put my code inside <pre></pre> tags =)
|
|
|
|
|
I think your own message have answered your question.
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.
|
|
|
|
|
Are you referring to the code below?
char MESS4[21] = {"CellID | 15831-32\n\x1A"}; //Example of sending CellID
This code is set as the prefix value to simulate the sending of Cell ID via SMS. It does not simulate the retrieving of the Cell ID automatically.
|
|
|
|
|
No, I was referring to your question:
[quote]
May I know why I need to reformat my message with tags. Is it HTML?
[/quote]
And the answer is obviously... yes. Now your code in the original question is much more readable and the help you need will come easily. Just keep an eye to new answers hanging on your original message, that's the good point of the tree-view of the threads.
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.
modified on Wednesday, December 23, 2009 6:24 AM
|
|
|
|
|
On the other hand, I can not help you so much because I have not used that components, but I am going to make you some questions (and the answer to this points should be added in the original question) trying to isolate where the problem is:
- Have you tested your programm?
- You say want you want/need to have, but what are you actually getting?
- Is there any compiler errors? If yes, which ones and referred to which line?
- A short explanation about what each external component do and how it is supposed that C interact with them, would not be bad.
The point is: you are using very specifical components, that can be the source of your "not working" status, and this has not so much with C contents, so it may happen that the people that could help you with the C programm doesn't have the needed information about the extern components you are using.
This can be translated to: Your code may be "gramatically" correct, but the parameters for the interaction with the other components are not correct. So the program does not do what you want it to do.
I have found this places using google. Take a look, they may eventually help you:
http://www.microchip.com/forums/tm.aspx?m=382659&mpage=1&key=timer%2cdelay񝛃[^]
http://old.nabble.com/PIC18-for-the-clueless-td21283504.html[^]
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1231118910[^]
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.
|
|
|
|
|
I have added new info for the question I posted. Thanks
|
|
|
|
|
You are welcome.
[quote]
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.
[/quote]
As I supposed, if you can send the Test-ID out, your problem is in the interaction with the external components.
Have you checked out the links I gave you? I think I have seen an #include in one of the posts that you don't have.
I don't have enough knowledge to tell you a solution, but I am going to tell you some points I have notized or I would make to find out where the error is.
- In your "InterruptHandlerHigh()" you have 2 nested IFs without any else. I would add the elses with a pulse to a not used output of the microchip or sendind a message with "Error_IF_x" where X is the code (you told sending a fixed mesage is working ok). Because as it is you dont know which conditions is failing (if they fail).
- I see no call to your function add_accelerometer. You declare it, you program it, but you don't call it anywhere.
- In your main function you have a endless loop with the "while (1)", so the first time you get into it the variable "ADCON0" is =0b00000001 and you get "X1", then you change it to "ADCON0=0b00000101;" and get "Y1" and then you change it to "ADCON0=0b00001001;" to get Z1, but as it is a loop the next time it starts again you are missing the needed "ADCON0=0b00000001;" to read X1 a second time.
That will make you unable to read X1 until your main function starts again.
- What are ADRESSH and ADRESSL and where do they come from? I haven't seen them in your code. I guess they are constants and they are defined in one of the included .h, but if not...
I hope it helps you.
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.
|
|
|
|
|
Sorry, for the late reply.
Actually, for X, Y and Z (accelerometer part), I would like to read only once and store in the array. Whereas for the X1, Y1 and Z1 is to keep on reading it. If there is the changes of value >15 or <15 in any axis, it will trigger the accelerometer and send the signal to the PIC Controller. May I know how I could insert it inside my code?
For ADRESH and ADRESL, I did some researched on it. It is used to convert the analog signal to digital. If we used WATCH on the MPLAB, it will able to show the value there. However, I am not sure if I have to include any library (.h) file in my programming.
Merry X'mas and Happy New Year
|
|
|
|
|